Package com.yahoo.tensor
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 Summary
Constructors Constructor Description Builder(int dimensions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DimensionSizes.Builder
add(long size)
DimensionSizes
build()
Build this.int
dimensions()
Returns the number of dimensions this provides the size ofDimensionSizes.Builder
set(int dimensionIndex, long size)
long
size(int dimensionIndex)
Returns the length of this in the nth dimension
-
-
-
Method Detail
-
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.
-
-