V
- the type of the values of the tensorpublic class OngoingTensorManipulation<V>
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
OngoingEitherGet<V> |
either(V defaultValue) |
Tensor<V> |
extract(java.lang.Object... coordinates) |
Tensor<V> |
extract(Position position) |
<C1> java.util.Set<C1> |
extractCoordinatesOfType(java.lang.Class<C1> coordinateType)
Retrieves all the unique coordinates of the given type.
|
Tensor<V> |
extractWhereTrue(Tensor<java.lang.Boolean> mask)
Extracts from the tensor only those elements where the values in the given mask is
true . |
V |
get(java.lang.Object... coordinates) |
V |
get(Position position) |
<C> OngoingDimensionReduction<C,V> |
reduce(java.lang.Class<C> dimension) |
public Tensor<V> extractWhereTrue(Tensor<java.lang.Boolean> mask)
true
. The resulting
tensors will then have the same dimensionality as the original tensor, but will only have that many elements as
there are true
elements in the mask tensor.mask
- the mask which determines which elements shall be present in the new tensor.true
flags in the maskpublic <C1> java.util.Set<C1> extractCoordinatesOfType(java.lang.Class<C1> coordinateType)
coordinateType
- the type of the coordinate to extractpublic V get(java.lang.Object... coordinates)
public OngoingEitherGet<V> either(V defaultValue)
public <C> OngoingDimensionReduction<C,V> reduce(java.lang.Class<C> dimension)