public class Rename extends PrimitiveTensorFunction
Modifier and Type | Field and Description |
---|---|
private TensorFunction |
argument |
private List<String> |
fromDimensions |
private Map<String,String> |
fromToMap |
private List<String> |
toDimensions |
Constructor and Description |
---|
Rename(TensorFunction argument,
List<String> fromDimensions,
List<String> toDimensions) |
Rename(TensorFunction argument,
String fromDimension,
String toDimension) |
Modifier and Type | Method and Description |
---|---|
List<TensorFunction> |
arguments()
Returns the function arguments of this node in the order they are applied
|
<NAMETYPE extends TypeContext.Name> |
evaluate(EvaluationContext<NAMETYPE> context)
Evaluates this tensor.
|
List<String> |
fromDimensions() |
private static Map<String,String> |
fromToMap(List<String> fromDimensions,
List<String> toDimensions) |
private TensorAddress |
rename(TensorAddress address,
int[] toIndexes) |
List<String> |
toDimensions() |
PrimitiveTensorFunction |
toPrimitive()
Translate this function - and all of its arguments recursively -
to a tree of primitive functions only.
|
String |
toString(ToStringContext context)
Return a string representation of this context.
|
private String |
toVectorString(List<String> elements) |
private TensorType |
type(TensorType type) |
<NAMETYPE extends TypeContext.Name> |
type(TypeContext<NAMETYPE> context)
Returns the type of the tensor this produces given the input types in the context
|
TensorFunction |
withArguments(List<TensorFunction> arguments)
Returns a copy of this tensor function with the arguments replaced by the given list of arguments.
|
evaluate, toString
private final TensorFunction argument
public Rename(TensorFunction argument, String fromDimension, String toDimension)
public Rename(TensorFunction argument, List<String> fromDimensions, List<String> toDimensions)
private static Map<String,String> fromToMap(List<String> fromDimensions, List<String> toDimensions)
public List<TensorFunction> arguments()
TensorFunction
arguments
in class TensorFunction
public TensorFunction withArguments(List<TensorFunction> arguments)
TensorFunction
withArguments
in class TensorFunction
public PrimitiveTensorFunction toPrimitive()
TensorFunction
toPrimitive
in class TensorFunction
public <NAMETYPE extends TypeContext.Name> TensorType type(TypeContext<NAMETYPE> context)
TensorFunction
type
in class TensorFunction
context
- a context which must be passed to all nexted functions when evaluatingprivate TensorType type(TensorType type)
public <NAMETYPE extends TypeContext.Name> Tensor evaluate(EvaluationContext<NAMETYPE> context)
TensorFunction
evaluate
in class TensorFunction
context
- a context which must be passed to all nexted functions when evaluatingprivate TensorAddress rename(TensorAddress address, int[] toIndexes)
public String toString(ToStringContext context)
TensorFunction
toString
in class TensorFunction
context
- a context which must be passed to all nested functions when requesting the string valueCopyright © 2018. All rights reserved.