Class DimensionSizes.Builder

java.lang.Object
com.yahoo.tensor.DimensionSizes.Builder
Enclosing class:
DimensionSizes

public static final class DimensionSizes.Builder extends Object
Builder of a set of dimension sizes. Dimensions whose size is not set before building will get size 0.
  • Constructor Details

    • Builder

      public Builder(int dimensions)
  • Method Details

    • set

      public DimensionSizes.Builder set(int dimensionIndex, long size)
    • add

      public DimensionSizes.Builder add(long size)
    • size

      public long size(int dimensionIndex)
      Returns the length of this in the nth dimension
      Throws:
      IllegalArgumentException - if the index is larger than the number of dimensions in this tensor minus one
    • dimensions

      public int dimensions()
      Returns the number of dimensions this provides the size of
    • build

      public DimensionSizes build()
      Build this. This builder becomes invalid after calling this.