Package com.yahoo.tensor.functions
Class Random<NAMETYPE extends Name>
- java.lang.Object
-
- com.yahoo.tensor.functions.TensorFunction<NAMETYPE>
-
- com.yahoo.tensor.functions.CompositeTensorFunction<NAMETYPE>
-
- com.yahoo.tensor.functions.Random<NAMETYPE>
-
public class Random<NAMETYPE extends Name> extends CompositeTensorFunction<NAMETYPE>
A tensor generator which returns a tensor of any dimension filled with random numbers between 0 and 1.- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description Random(TensorType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<TensorFunction<NAMETYPE>>
arguments()
Returns the function arguments of this node in the order they are appliedint
hashCode()
Returns a hashcode computed from the data in thisPrimitiveTensorFunction<NAMETYPE>
toPrimitive()
Translate this function - and all of its arguments recursively - to a tree of primitive functions only.String
toString(ToStringContext<NAMETYPE> context)
Return a string representation of this context.TensorFunction<NAMETYPE>
withArguments(List<TensorFunction<NAMETYPE>> arguments)
Returns a copy of this tensor function with the arguments replaced by the given list of arguments.-
Methods inherited from class com.yahoo.tensor.functions.CompositeTensorFunction
evaluate, type
-
Methods inherited from class com.yahoo.tensor.functions.TensorFunction
asScalarFunction, evaluate, toString
-
-
-
-
Constructor Detail
-
Random
public Random(TensorType type)
-
-
Method Detail
-
arguments
public List<TensorFunction<NAMETYPE>> arguments()
Description copied from class:TensorFunction
Returns the function arguments of this node in the order they are applied- Specified by:
arguments
in classTensorFunction<NAMETYPE extends Name>
-
withArguments
public TensorFunction<NAMETYPE> withArguments(List<TensorFunction<NAMETYPE>> arguments)
Description copied from class:TensorFunction
Returns a copy of this tensor function with the arguments replaced by the given list of arguments.- Specified by:
withArguments
in classTensorFunction<NAMETYPE extends Name>
-
toPrimitive
public PrimitiveTensorFunction<NAMETYPE> toPrimitive()
Description copied from class:TensorFunction
Translate this function - and all of its arguments recursively - to a tree of primitive functions only.- Specified by:
toPrimitive
in classTensorFunction<NAMETYPE extends Name>
- Returns:
- a tree of primitive functions implementing this
-
toString
public String toString(ToStringContext<NAMETYPE> context)
Description copied from class:TensorFunction
Return a string representation of this context.- Specified by:
toString
in classTensorFunction<NAMETYPE extends Name>
- Parameters:
context
- a context which must be passed to all nested functions when requesting the string value
-
hashCode
public int hashCode()
Description copied from class:TensorFunction
Returns a hashcode computed from the data in this- Specified by:
hashCode
in classTensorFunction<NAMETYPE extends Name>
-
-