public final class TensorStructurals
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <S> OngoingCompletion<S> |
complete(Tensor<S> tensor) |
static <V> Tensor<V> |
completeWith(Tensor<V> tensor,
Tensor<V> second) |
static <S> void |
consumeScalars(Tensor<S> tensor,
java.util.function.BiConsumer<Position,S> consumer) |
static <S> void |
consumeScalars(Tensor<S> tensor,
java.util.function.Consumer<S> consumer) |
static <V> OngoingTensorFiltering<V> |
filter(Tensor<V> tensor) |
static <S> OngoingFlattening<S> |
flatten(Tensor<S> tensor) |
static <V> OngoingTensorManipulation<V> |
from(Tensor<V> tensor) |
static <E> Tensor<E> |
merge(java.lang.Iterable<Tensor<E>> tensors)
Merges the given set of the Tensors based on information in their context and dimensions.
|
static <V> Tensor<V> |
mergeContextIntoShape(Tensor<V> tensor) |
static <V> OngoingResamplingStart<V> |
resample(Tensor<V> tensor)
Starting point for a fluent clause to describe resampling in one or more dimensions.
|
static <V> Tensor<V> |
setContext(Tensor<V> tensor,
Position context) |
static <S> Tensor<S> |
stripContext(Tensor<S> tensor) |
static <S,T> Tensor<T> |
transformEntries(Tensor<S> tensor,
java.util.function.Function<java.util.Map.Entry<Position,S>,T> function) |
static <S,T> Tensor<T> |
transformScalars(Tensor<S> tensor,
java.util.function.BiFunction<Position,S,T> function) |
static <S,T> Tensor<T> |
transformScalars(Tensor<S> tensor,
java.util.function.Function<S,T> function) |
public static <V> OngoingTensorManipulation<V> from(Tensor<V> tensor)
public static <E> Tensor<E> merge(java.lang.Iterable<Tensor<E>> tensors)
tensors
- to be merged.java.lang.IllegalArgumentException
- if zero or one tensor is put to be merged OR if tensors dimensionality and their
context positions dimensionality is not equal OR tensor context is empty.public static <S> OngoingFlattening<S> flatten(Tensor<S> tensor)
public static final <S> OngoingCompletion<S> complete(Tensor<S> tensor)
public static <S,T> Tensor<T> transformEntries(Tensor<S> tensor, java.util.function.Function<java.util.Map.Entry<Position,S>,T> function)
public static <S,T> Tensor<T> transformScalars(Tensor<S> tensor, java.util.function.Function<S,T> function)
public static <S,T> Tensor<T> transformScalars(Tensor<S> tensor, java.util.function.BiFunction<Position,S,T> function)
public static <S> void consumeScalars(Tensor<S> tensor, java.util.function.Consumer<S> consumer)
public static <S> void consumeScalars(Tensor<S> tensor, java.util.function.BiConsumer<Position,S> consumer)
public static final <V> OngoingTensorFiltering<V> filter(Tensor<V> tensor)
public static final <V> OngoingResamplingStart<V> resample(Tensor<V> tensor)
Tensoric<V> resampled = resample(aTensor)
.repeat(Integer.class)
.then().repeat(String.class)
.toTensoric();
Note: The order of the options is important, as the resampling will be performed in the given order!
For options which require a field, (e.g. linear interpolation), see the version in
TensorSupport.resample(Tensor)
.
tensor
- the tensor to be resampled