public final class Tensors
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static TensorData |
asDenseTensor(TensorType type,
double[] doubles)
Convert an array value to a dense tensor.
|
static TensorData |
asDenseTensor(TensorType type,
float[] floats)
Convert an array value to a dense tensor.
|
static TensorData |
asDenseTensor(TensorType type,
int[] ints)
Convert an array value to a dense tensor.
|
static TensorData |
asDenseTensor(TensorType type,
java.util.List<?> values)
Convert a list value to a dense tensor.
|
static TensorData |
asDenseTensor(TensorType type,
long[] longs)
Convert an array value to a dense tensor.
|
static TensorData |
asScalarTensor(TensorType type,
java.lang.Object scalar)
Convert a scalar value to a tensor.
|
static TensorData |
asSparseTensor(TensorType type,
java.util.Map<?,?> values)
Convert a map value to a sparse tensor.
|
static TensorData |
asSparseTensor(TensorType type,
java.util.Set<?> dimensionValues)
Convert a set value to a sparse tensor.
|
public static TensorData asScalarTensor(TensorType type, java.lang.Object scalar)
type - the type of the result.scalar - the scalar value.public static TensorData asDenseTensor(TensorType type, float[] floats)
type - the type of the result.floats - the array value.public static TensorData asDenseTensor(TensorType type, int[] ints)
type - the type of the result.ints - the array value.public static TensorData asDenseTensor(TensorType type, long[] longs)
type - the type of the result.longs - the array value.public static TensorData asDenseTensor(TensorType type, double[] doubles)
type - the type of the result.doubles - the array value.public static TensorData asDenseTensor(TensorType type, java.util.List<?> values)
type - the type of the result.values - the list value.public static TensorData asSparseTensor(TensorType type, java.util.Set<?> dimensionValues)
type - the type of the result.dimensionValues - the values for the single dimension.public static TensorData asSparseTensor(TensorType type, java.util.Map<?,?> values)
type - the type of the result.values - the values for the single dimension and corresponding tensor values.