Class DimensionSizes

java.lang.Object
com.yahoo.tensor.DimensionSizes

public final class DimensionSizes extends Object
The sizes of a set of dimensions.
Author:
bratseth
  • Method Details

    • of

      public static DimensionSizes of(TensorType type)
      Create sizes from a type containing bound indexed dimensions only.
      Throws:
      IllegalStateException - if the type contains dimensions which are not bound and indexed
    • 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
    • totalSize

      public long totalSize()
      Returns the product of the sizes of this
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object