Join us at TensorFlow World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

Tensors

public final class Tensors

Type-safe factory methods for creating Tensor objects.

Public Methods

static Tensor<Float>
create(float[][][] data)
Creates a rank-3 tensor of float elements.
static Tensor<Double>
create(double[] data)
Creates a rank-1 tensor of double elements.
static Tensor<Boolean>
create(boolean[][][][][] data)
Creates a rank-5 tensor of boolean elements.
static Tensor<String>
create(byte[][] data)
Creates a rank-1 tensor of byte elements.
static Tensor<Long>
create(long[] data)
Creates a rank-1 tensor of long elements.
static Tensor<Double>
create(double data)
Creates a scalar tensor containing a single double element.
static Tensor<Integer>
create(int[][][][][] data)
Creates a rank-5 tensor of int elements.
static Tensor<Integer>
create(int[][][][][][] data)
Creates a rank-6 tensor of int elements.
static Tensor<Boolean>
create(boolean[][] data)
Creates a rank-2 tensor of boolean elements.
static Tensor<Float>
create(float[][][][] data)
Creates a rank-4 tensor of float elements.
static Tensor<Double>
create(double[][] data)
Creates a rank-2 tensor of double elements.
static Tensor<String>
create(byte[][][] data)
Creates a rank-2 tensor of byte elements.
static Tensor<String>
create(byte[][][][][] data)
Creates a rank-4 tensor of byte elements.
static Tensor<Float>
create(float[][][][][] data)
Creates a rank-5 tensor of float elements.
static Tensor<Integer>
create(int data)
Creates a scalar tensor containing a single int element.
static Tensor<Long>
create(long[][][][] data)
Creates a rank-4 tensor of long elements.
static Tensor<Boolean>
create(boolean data)
Creates a scalar tensor containing a single boolean element.
static Tensor<Double>
create(double[][][] data)
Creates a rank-3 tensor of double elements.
static Tensor<Float>
create(float[][][][][][] data)
Creates a rank-6 tensor of float elements.
static Tensor<String>
create(byte[] data)
Creates a scalar tensor containing a single byte element.
static Tensor<Integer>
create(int[][] data)
Creates a rank-2 tensor of int elements.
static Tensor<Integer>
create(int[][][] data)
Creates a rank-3 tensor of int elements.
static Tensor<Boolean>
create(boolean[][][] data)
Creates a rank-3 tensor of boolean elements.
static Tensor<Double>
create(double[][][][][] data)
Creates a rank-5 tensor of double elements.
static Tensor<Float>
create(float data)
Creates a scalar tensor containing a single float element.
static Tensor<Long>
create(long[][][] data)
Creates a rank-3 tensor of long elements.
static Tensor<Boolean>
create(boolean[][][][] data)
Creates a rank-4 tensor of boolean elements.
static Tensor<Float>
create(float[][] data)
Creates a rank-2 tensor of float elements.
static Tensor<String>
create(byte[][][][] data)
Creates a rank-3 tensor of byte elements.
static Tensor<Long>
create(long[][][][][][] data)
Creates a rank-6 tensor of long elements.
static Tensor<Long>
create(long[][] data)
Creates a rank-2 tensor of long elements.
static Tensor<Boolean>
create(boolean[] data)
Creates a rank-1 tensor of boolean elements.
static Tensor<Float>
create(float[] data)
Creates a rank-1 tensor of float elements.
static Tensor<Long>
create(long[][][][][] data)
Creates a rank-5 tensor of long elements.
static Tensor<String>
create(String data)
Creates a scalar String tensor using the default, UTF-8 encoding.
static Tensor<Double>
create(double[][][][] data)
Creates a rank-4 tensor of double elements.
static Tensor<Boolean>
create(boolean[][][][][][] data)
Creates a rank-6 tensor of boolean elements.
static Tensor<Integer>
create(int[][][][] data)
Creates a rank-4 tensor of int elements.
static Tensor<Long>
create(long data)
Creates a scalar tensor containing a single long element.
static Tensor<String>
create(String data, Charset charset)
Creates a scalar String tensor using a specified encoding.
static Tensor<Double>
create(double[][][][][][] data)
Creates a rank-6 tensor of double elements.
static Tensor<Integer>
create(int[] data)
Creates a rank-1 tensor of int elements.
static Tensor<String>
create(byte[][][][][][] data)
Creates a rank-5 tensor of byte elements.

Inherited Methods

Public Methods

public static Tensor<Float> create (float[][][] data)

Creates a rank-3 tensor of float elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Double> create (double[] data)

Creates a rank-1 tensor of double elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Boolean> create (boolean[][][][][] data)

Creates a rank-5 tensor of boolean elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<String> create (byte[][] data)

Creates a rank-1 tensor of byte elements.

Parameters
data An array containing the data to put into the new tensor. String elements are sequences of bytes from the last array dimension.

public static Tensor<Long> create (long[] data)

Creates a rank-1 tensor of long elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Double> create (double data)

Creates a scalar tensor containing a single double element.

Parameters
data The value to put into the new scalar tensor.

public static Tensor<Integer> create (int[][][][][] data)

Creates a rank-5 tensor of int elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Integer> create (int[][][][][][] data)

Creates a rank-6 tensor of int elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Boolean> create (boolean[][] data)

Creates a rank-2 tensor of boolean elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Float> create (float[][][][] data)

Creates a rank-4 tensor of float elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Double> create (double[][] data)

Creates a rank-2 tensor of double elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<String> create (byte[][][] data)

Creates a rank-2 tensor of byte elements.

Parameters
data An array containing the data to put into the new tensor. String elements are sequences of bytes from the last array dimension.

public static Tensor<String> create (byte[][][][][] data)

Creates a rank-4 tensor of byte elements.

Parameters
data An array containing the data to put into the new tensor. String elements are sequences of bytes from the last array dimension.

public static Tensor<Float> create (float[][][][][] data)

Creates a rank-5 tensor of float elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Integer> create (int data)

Creates a scalar tensor containing a single int element.

Parameters
data The value to put into the new scalar tensor.

public static Tensor<Long> create (long[][][][] data)

Creates a rank-4 tensor of long elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Boolean> create (boolean data)

Creates a scalar tensor containing a single boolean element.

Parameters
data The value to put into the new scalar tensor.

public static Tensor<Double> create (double[][][] data)

Creates a rank-3 tensor of double elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Float> create (float[][][][][][] data)

Creates a rank-6 tensor of float elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<String> create (byte[] data)

Creates a scalar tensor containing a single byte element.

Parameters
data An array containing the data to put into the new tensor. String elements are sequences of bytes from the last array dimension.

public static Tensor<Integer> create (int[][] data)

Creates a rank-2 tensor of int elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Integer> create (int[][][] data)

Creates a rank-3 tensor of int elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Boolean> create (boolean[][][] data)

Creates a rank-3 tensor of boolean elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Double> create (double[][][][][] data)

Creates a rank-5 tensor of double elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Float> create (float data)

Creates a scalar tensor containing a single float element.

Parameters
data The value to put into the new scalar tensor.

public static Tensor<Long> create (long[][][] data)

Creates a rank-3 tensor of long elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Boolean> create (boolean[][][][] data)

Creates a rank-4 tensor of boolean elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Float> create (float[][] data)

Creates a rank-2 tensor of float elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<String> create (byte[][][][] data)

Creates a rank-3 tensor of byte elements.

Parameters
data An array containing the data to put into the new tensor. String elements are sequences of bytes from the last array dimension.

public static Tensor<Long> create (long[][][][][][] data)

Creates a rank-6 tensor of long elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Long> create (long[][] data)

Creates a rank-2 tensor of long elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Boolean> create (boolean[] data)

Creates a rank-1 tensor of boolean elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Float> create (float[] data)

Creates a rank-1 tensor of float elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Long> create (long[][][][][] data)

Creates a rank-5 tensor of long elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<String> create (String data)

Creates a scalar String tensor using the default, UTF-8 encoding.

Parameters
data The string to put into the new scalar tensor.

public static Tensor<Double> create (double[][][][] data)

Creates a rank-4 tensor of double elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Boolean> create (boolean[][][][][][] data)

Creates a rank-6 tensor of boolean elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Integer> create (int[][][][] data)

Creates a rank-4 tensor of int elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Long> create (long data)

Creates a scalar tensor containing a single long element.

Parameters
data The value to put into the new scalar tensor.

public static Tensor<String> create (String data, Charset charset)

Creates a scalar String tensor using a specified encoding.

Parameters
data The string to put into the new scalar tensor.
charset The encoding from String to bytes.

public static Tensor<Double> create (double[][][][][][] data)

Creates a rank-6 tensor of double elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<Integer> create (int[] data)

Creates a rank-1 tensor of int elements.

Parameters
data An array containing the values to put into the new tensor. The dimensions of the new tensor will match those of the array.

public static Tensor<String> create (byte[][][][][][] data)

Creates a rank-5 tensor of byte elements.

Parameters
data An array containing the data to put into the new tensor. String elements are sequences of bytes from the last array dimension.