Package com.yahoo.tensor
Class IndexedTensor.Builder
java.lang.Object
com.yahoo.tensor.IndexedTensor.Builder
- All Implemented Interfaces:
Tensor.Builder
- Direct Known Subclasses:
IndexedTensor.BoundBuilder
- Enclosing class:
- IndexedTensor
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.yahoo.tensor.Tensor.Builder
Tensor.Builder.CellBuilder
-
Method Summary
Modifier and TypeMethodDescriptionabstract IndexedTensor
build()
abstract IndexedTensor.Builder
cell
(double value, long... indexes) Add a cellabstract IndexedTensor.Builder
cell
(float value, long... indexes) static IndexedTensor.Builder
of
(TensorType type) Creates a suitable builder for the given typestatic IndexedTensor.Builder
of
(TensorType type, double[] values) Creates a builder initialized with the given valuesstatic IndexedTensor.Builder
of
(TensorType type, float[] values) Creates a builder initialized with the given valuesstatic IndexedTensor.Builder
of
(TensorType type, DimensionSizes sizes) Create a builder with dimension size information for this instance.static IndexedTensor.Builder
of
(TensorType type, DimensionSizes sizes, double[] values) Creates a builder initialized with the given valuesstatic IndexedTensor.Builder
of
(TensorType type, DimensionSizes sizes, float[] values) Creates a builder initialized with the given valuestype()
Returns the type of the tensor this is building
-
Method Details
-
of
Description copied from interface:Tensor.Builder
Creates a suitable builder for the given type -
of
Creates a builder initialized with the given values- Parameters:
type
- the type of the tensor to buildvalues
- the initial values of the tensor. This transfers ownership of the value array - it must not be further mutated by the caller
-
of
Creates a builder initialized with the given values- Parameters:
type
- the type of the tensor to buildvalues
- the initial values of the tensor. This transfers ownership of the value array - it must not be further mutated by the caller
-
of
Create a builder with dimension size information for this instance. Must be one size entry per dimension, and, agree with the type size information when specified in the type. If sizes are completely specified in the type this size information is redundant. -
of
Creates a builder initialized with the given values- Parameters:
type
- the type of the tensor to buildvalues
- the initial values of the tensor in the standard value order. This transfers ownership of the value array - it must not be further mutated by the caller
-
of
Creates a builder initialized with the given values- Parameters:
type
- the type of the tensor to buildvalues
- the initial values of the tensor in the standard value order. This transfers ownership of the value array - it must not be further mutated by the caller
-
cell
Description copied from interface:Tensor.Builder
Add a cell- Specified by:
cell
in interfaceTensor.Builder
-
cell
- Specified by:
cell
in interfaceTensor.Builder
-
type
Description copied from interface:Tensor.Builder
Returns the type of the tensor this is building- Specified by:
type
in interfaceTensor.Builder
-
build
- Specified by:
build
in interfaceTensor.Builder
-