Class DimensionSizes.Builder

  • Enclosing class:
    DimensionSizes

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

      Constructors 
      Constructor Description
      Builder​(int dimensions)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DimensionSizes build()
      Build this.
      int dimensions()
      Returns the number of dimensions this provides the size of
      DimensionSizes.Builder set​(int dimensionIndex, long size)  
      long size​(int dimensionIndex)
      Returns the length of this in the nth dimension
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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:
        java.lang.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.