Package com.yahoo.tensor
Class DimensionSizes
- java.lang.Object
-
- com.yahoo.tensor.DimensionSizes
-
public final class DimensionSizes extends java.lang.Object
The sizes of a set of dimensions.- Author:
- bratseth
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DimensionSizes.Builder
Builder of a set of dimension sizes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
dimensions()
Returns the number of dimensions this provides the size ofboolean
equals(java.lang.Object o)
int
hashCode()
static DimensionSizes
of(TensorType type)
Create sizes from a type containing bound indexed dimensions only.long
size(int dimensionIndex)
Returns the length of this in the nth dimensionlong
totalSize()
Returns the product of the sizes of this
-
-
-
Method Detail
-
of
public static DimensionSizes of(TensorType type)
Create sizes from a type containing bound indexed dimensions only.- Throws:
java.lang.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:
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
-
totalSize
public long totalSize()
Returns the product of the sizes of this
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-