# Tensors

public final class **Tensors** Type-safe factory methods for creating `https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor` objects.

### Public Methods

|---|---|
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(float[][][]))(float\[\]\[\]\[\] data) Creates a rank-3 tensor of `float` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(double[]))(double\[\] data) Creates a rank-1 tensor of `double` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(boolean[][][][][]))(boolean\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 tensor of `boolean` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(byte[][]))(byte\[\]\[\] data) Creates a rank-1 tensor of `byte` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(long[]))(long\[\] data) Creates a rank-1 tensor of `long` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(double))(double data) Creates a scalar tensor containing a single `double` element. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(int[][][][][]))(int\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 tensor of `int` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(int[][][][][][]))(int\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-6 tensor of `int` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(boolean[][]))(boolean\[\]\[\] data) Creates a rank-2 tensor of `boolean` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(float[][][][]))(float\[\]\[\]\[\]\[\] data) Creates a rank-4 tensor of `float` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(double[][]))(double\[\]\[\] data) Creates a rank-2 tensor of `double` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(byte[][][]))(byte\[\]\[\]\[\] data) Creates a rank-2 tensor of `byte` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(byte[][][][][]))(byte\[\]\[\]\[\]\[\]\[\] data) Creates a rank-4 tensor of `byte` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(float[][][][][]))(float\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 tensor of `float` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(int))(int data) Creates a scalar tensor containing a single `int` element. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(long[][][][]))(long\[\]\[\]\[\]\[\] data) Creates a rank-4 tensor of `long` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(boolean))(boolean data) Creates a scalar tensor containing a single `boolean` element. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(double[][][]))(double\[\]\[\]\[\] data) Creates a rank-3 tensor of `double` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(float[][][][][][]))(float\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-6 tensor of `float` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(byte[]))(byte\[\] data) Creates a scalar tensor containing a single `byte` element. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(int[][]))(int\[\]\[\] data) Creates a rank-2 tensor of `int` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(int[][][]))(int\[\]\[\]\[\] data) Creates a rank-3 tensor of `int` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(boolean[][][]))(boolean\[\]\[\]\[\] data) Creates a rank-3 tensor of `boolean` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(double[][][][][]))(double\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 tensor of `double` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(float))(float data) Creates a scalar tensor containing a single `float` element. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(long[][][]))(long\[\]\[\]\[\] data) Creates a rank-3 tensor of `long` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(boolean[][][][]))(boolean\[\]\[\]\[\]\[\] data) Creates a rank-4 tensor of `boolean` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(float[][]))(float\[\]\[\] data) Creates a rank-2 tensor of `float` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(byte[][][][]))(byte\[\]\[\]\[\]\[\] data) Creates a rank-3 tensor of `byte` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(long[][][][][][]))(long\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-6 tensor of `long` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(long[][]))(long\[\]\[\] data) Creates a rank-2 tensor of `long` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(boolean[]))(boolean\[\] data) Creates a rank-1 tensor of `boolean` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(float[]))(float\[\] data) Creates a rank-1 tensor of `float` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(long[][][][][]))(long\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 tensor of `long` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(java.lang.String))(String data) Creates a scalar String tensor using the default, UTF-8 encoding. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(double[][][][]))(double\[\]\[\]\[\]\[\] data) Creates a rank-4 tensor of `double` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(boolean[][][][][][]))(boolean\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-6 tensor of `boolean` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(int[][][][]))(int\[\]\[\]\[\]\[\] data) Creates a rank-4 tensor of `int` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(long))(long data) Creates a scalar tensor containing a single `long` element. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(java.lang.String,%20java.nio.charset.Charset))(String data, Charset charset) Creates a scalar String tensor using a specified encoding. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(double[][][][][][]))(double\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-6 tensor of `double` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(int[]))(int\[\] data) Creates a rank-1 tensor of `int` elements. |
| static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensors#create(byte[][][][][][]))(byte\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 tensor of `byte` elements. |

### Inherited Methods

From class java.lang.Object

|---|---|
| boolean | equals(Object arg0) |
| final Class\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| String | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public static [Tensor](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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](https://www.tensorflow.org/api_docs/java/org/tensorflow/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. |
|---|---|