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 Object implements Tensor.Builder
  • Method Details

    • 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 build
      values - 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 build
      values - 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 build
      values - 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 build
      values - 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 interface Tensor.Builder
    • cell

      public abstract IndexedTensor.Builder cell(float value, long... indexes)
      Specified by:
      cell in interface Tensor.Builder
    • type

      public TensorType type()
      Description copied from interface: Tensor.Builder
      Returns the type of the tensor this is building
      Specified by:
      type in interface Tensor.Builder
    • build

      public abstract IndexedTensor build()
      Specified by:
      build in interface Tensor.Builder