public interface WithShapeOrScalarOrVectorTensor<V> extends WithShapeOrScalarOrVector<V>
Modifier and Type | Method and Description |
---|---|
Tensor<V> |
scalar(V value)
This method created and return a scalar
Tensor instance
which wraps the provided value. |
default Tensor<V> |
vector(java.lang.Iterable<V> values)
This method creates and returns a vector
Tensor instance
which wraps the provided values. |
default Tensor<V> |
vector(java.util.List<V> values)
This method creates and returns a vector
Tensor instance
which wraps the provided values. |
Tensor<V> |
vector(V... values)
This method creates and returns a vector
Tensor instance
which wraps the provided values. |
IterByOrIterFromOrAllTensor<V> |
withShape(int... shape)
Define a tensor shape by passing an array of int values to this method,
which represent the shape of the
Tensor that should be built. |
default <N extends java.lang.Number> |
withShape(java.util.List<N> shape)
Define a tensor shape by passing a list of numbers to this method,
which represent the shape of the
Tensor that should be built. |
IterByOrIterFromOrAllTensor<V> withShape(int... shape)
Tensor
that should be built.
This should be called immediately after having specified the type of the tensor.withShape
in interface WithShapeOrScalarOrVector<V>
shape
- The shape array of the Tensor
that should be built.default <N extends java.lang.Number> IterByOrIterFromOrAllTensor<V> withShape(java.util.List<N> shape)
Tensor
that should be built.
This should be called immediately after having specified the type of the tensor.withShape
in interface WithShapeOrScalarOrVector<V>
shape
- The shape list of the Tensor
that should be built.Tensor<V> vector(V... values)
Tensor
instance
which wraps the provided values.vector
in interface WithShapeOrScalarOrVector<V>
values
- The values which ought to be wrapped by a new vector Tensor
instance.Tensor
instance wrapping the provided values.default Tensor<V> vector(java.util.List<V> values)
Tensor
instance
which wraps the provided values.vector
in interface WithShapeOrScalarOrVector<V>
values
- The list of values which ought to be turned into a vector.default Tensor<V> vector(java.lang.Iterable<V> values)
Tensor
instance
which wraps the provided values.vector
in interface WithShapeOrScalarOrVector<V>
values
- The list of values which ought to be turned into a vector.Tensor<V> scalar(V value)
Tensor
instance
which wraps the provided value.scalar
in interface WithShapeOrScalarOrVector<V>
value
- The value which ought to be wrapped by a new scalar Tensor
instance.Tensor
instance wrapping the provided value.