Class 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 Detail

      • Builder

        public Builder​(int dimensions)
    • Method Detail

      • 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.