Package com.yahoo.tensor
Class TensorType.Builder
java.lang.Object
com.yahoo.tensor.TensorType.Builder
- Enclosing class:
- TensorType
-
Constructor Summary
ConstructorDescriptionBuilder()
Creates an empty builder with cells of type doubleBuilder
(boolean allowDifferentSizes, TensorType... types) Builder
(TensorType... types) Creates a builder containing a combination of the dimensions of the given types If the same dimension is indexed with different size restrictions the smallest size will be used.Builder
(TensorType.Value valueType) Builder
(TensorType.Value valueType, Iterable<TensorType.Dimension> dimensions) Creates a builder from the given value type and dimensionsBuilder
(Iterable<TensorType.Dimension> dimensions) Creates a builder from the given dimensions, having double as the value type -
Method Summary
Modifier and TypeMethodDescriptionbuild()
dimension
(TensorType.Dimension dimension) Adds the given dimensiondimension
(String name, TensorType.Dimension.Type type) getDimension
(String dimension) Returns the given dimension, or empty if none is presentAdds an unbound indexed dimension to thisAdds a bound indexed dimension to thisAdds a mapped dimension to thisint
rank()
Returns the current number of dimensions in thisset
(TensorType.Dimension dimension) Adds or replaces a dimension in this
-
Constructor Details
-
Builder
public Builder()Creates an empty builder with cells of type double -
Builder
-
Builder
Creates a builder containing a combination of the dimensions of the given types If the same dimension is indexed with different size restrictions the smallest size will be used. If it is size restricted in one argument but not the other it will not be size restricted. If it is indexed in one and mapped in the other it will become mapped. The value type will be the largest of the value types of the input types -
Builder
-
Builder
Creates a builder from the given dimensions, having double as the value type -
Builder
Creates a builder from the given value type and dimensions
-
-
Method Details
-
rank
public int rank()Returns the current number of dimensions in this -
set
Adds or replaces a dimension in this -
indexed
Adds a bound indexed dimension to this- Throws:
IllegalArgumentException
- if the dimension is already present
-
indexed
Adds an unbound indexed dimension to this- Throws:
IllegalArgumentException
- if the dimension is already present
-
mapped
Adds a mapped dimension to this- Throws:
IllegalArgumentException
- if the dimension is already present
-
dimension
Adds the given dimension -
getDimension
Returns the given dimension, or empty if none is present -
dimension
-
build
-