public final class TensorInternals
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <S> Tensor<S> |
createFrom(Shape shape,
java.util.function.Function<Position,S> function) |
static <S> Tensor<S> |
createFrom(Shape shape,
java.util.function.Supplier<S> supplier) |
static <T> java.util.Set<java.util.Map.Entry<Position,T>> |
entrySetOf(Tensor<T> tensor) |
static <V> java.util.Map<Position,V> |
mapFrom(Tensor<V> tensor)
Returns a map representing the content of the given tensor.
|
static <T> OngoingMapOut<T> |
mapOut(Tensor<T> tensor) |
static <S> Tensor<S> |
sameValues(Shape shape,
S value) |
public static <T> OngoingMapOut<T> mapOut(Tensor<T> tensor)
public static <T> java.util.Set<java.util.Map.Entry<Position,T>> entrySetOf(Tensor<T> tensor)
public static <S> Tensor<S> createFrom(Shape shape, java.util.function.Supplier<S> supplier)
public static <S> Tensor<S> createFrom(Shape shape, java.util.function.Function<Position,S> function)
public static <V> java.util.Map<Position,V> mapFrom(Tensor<V> tensor)
Mappable
interface. If this interface is present, then its
Mappable.asMap()
method will be called. Otherwise, as a fallback, a new immutable map will be created
from information from the shape of the passed in tensor and its values.tensor
- the tensor from which a map should be returnedjava.lang.NullPointerException
- in case the passed in tensor is null