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
public abstract static class IndexedTensor.Builder extends java.lang.Object implements Tensor.Builder
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.yahoo.tensor.Tensor.Builder
Tensor.Builder.CellBuilder
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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 valuesTensorType
type()
Returns the type this is building
-
-
-
Method Detail
-
of
public static IndexedTensor.Builder of(TensorType type)
Description copied from interface:Tensor.Builder
Creates a suitable builder for the given type
-
of
public static IndexedTensor.Builder of(TensorType type, float[] values)
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
public static IndexedTensor.Builder of(TensorType type, double[] values)
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
public static IndexedTensor.Builder of(TensorType type, DimensionSizes sizes)
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
public static IndexedTensor.Builder of(TensorType type, DimensionSizes sizes, float[] values)
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
public static IndexedTensor.Builder of(TensorType type, DimensionSizes sizes, double[] values)
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
public abstract IndexedTensor.Builder cell(double value, long... indexes)
Description copied from interface:Tensor.Builder
Add a cell- Specified by:
cell
in interfaceTensor.Builder
-
cell
public abstract IndexedTensor.Builder cell(float value, long... indexes)
- Specified by:
cell
in interfaceTensor.Builder
-
type
public TensorType type()
Description copied from interface:Tensor.Builder
Returns the type this is building- Specified by:
type
in interfaceTensor.Builder
-
build
public abstract IndexedTensor build()
- Specified by:
build
in interfaceTensor.Builder
-
-