# Constant

public final class **Constant** An operator producing a constant value.

### Public Methods

|---|---|
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [asOutput](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#asOutput())() Returns the symbolic handle of a tensor. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20boolean[][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\]\[\]\[\]\[\] data) Creates a rank-4 constant of `boolean` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20long[]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\] data) Creates a rank-1 constant of `long` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20double[][][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-6 constant of `double` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20float))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float data) Creates a constant containing a single `float` element. |
| static \<T\> [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<T\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20java.lang.Object,%20java.lang.Class<T>))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, Object object, Class\<T\> type) Create a constant from a Java object. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20byte[]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\] data) Creates a constant containing a single `String` element, represented as an array of `byte`s. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20float[][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\]\[\]\[\] data) Creates a rank-3 constant of `float` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20long[],%20java.nio.FloatBuffer))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\] shape, FloatBuffer data) Create a `https://www.tensorflow.org/api_docs/java/org/tensorflow/DataType#FLOAT` constant with data from the given buffer. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20long[][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\]\[\] data) Creates a rank-2 constant of `long` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20double[][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\]\[\]\[\]\[\] data) Creates a rank-4 constant of `double` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20long[],%20java.nio.DoubleBuffer))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\] shape, DoubleBuffer data) Create a `https://www.tensorflow.org/api_docs/java/org/tensorflow/DataType#DOUBLE` constant with data from the given buffer. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20int[][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\]\[\]\[\] data) Creates a rank-3 constant of `int` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20byte[][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\]\[\]\[\]\[\]\[\] data) Creates a rank-4 constant of `String` elements, each represented as an array of `byte`s. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20java.lang.String))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, String data) Creates a `String` constant using the default, UTF-8 encoding. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20float[][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 constant of `float` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20int))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int data) Creates a constant containing a single `int` element. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20byte[][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\]\[\]\[\]\[\] data) Creates a rank-3 constant of `String` elements, each represented as an array of `byte`s. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20float[][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\]\[\] data) Creates a rank-2 constant of `float` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20boolean[][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\]\[\]\[\] data) Creates a rank-3 constant of `boolean` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20int[][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\]\[\] data) Creates a rank-2 constant of `int` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20long[],%20java.nio.IntBuffer))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\] shape, IntBuffer data) Create a `https://www.tensorflow.org/api_docs/java/org/tensorflow/DataType#INT32` constant with data from the given buffer. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20float[][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\]\[\]\[\]\[\] data) Creates a rank-4 constant of `float` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20long[][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\]\[\]\[\] data) Creates a rank-3 constant of `long` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20int[][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 constant of `int` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20java.lang.String,%20java.nio.charset.Charset))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, String data, Charset charset) Creates a `String` constant using a specified encoding. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20byte[][][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 constant of `String` elements, each represented as an array of `byte`s. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20float[]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\] data) Creates a rank-1 constant of `float` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20float[][][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-6 constant of `float` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20int[][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\]\[\]\[\]\[\] data) Creates a rank-4 constant of `int` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20double))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double data) Creates a constant containing a single `double` element. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20long[][][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-6 constant of `long` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20double[]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\] data) Creates a rank-1 constant of `double` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20long[][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\]\[\]\[\]\[\] data) Creates a rank-4 constant of `long` elements. |
| static \<T\> [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<T\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20java.lang.Class<T>,%20long[],%20java.nio.ByteBuffer))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, Class\<T\> type, long\[\] shape, ByteBuffer data) Create a constant with data from the given buffer. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20int[]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\] data) Creates a rank-1 constant of `int` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20double[][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\]\[\]\[\] data) Creates a rank-3 constant of `double` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20boolean[]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\] data) Creates a rank-1 constant of `boolean` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20int[][][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-6 constant of `int` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20byte[][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\]\[\]\[\] data) Creates a rank-2 constant of `String` elements, each represented as an array of `byte`s. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20boolean[][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\]\[\] data) Creates a rank-2 constant of `boolean` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20boolean[][][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\]\[\]\[\]\[\]\[\]\[\] data) Creates a rank-6 constant of `boolean` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20double[][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 constant of `double` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20double[][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\]\[\] data) Creates a rank-2 constant of `double` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20byte[][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\]\[\] data) Creates a rank-1 constant of `String` elements, each represented as an array of `byte`s. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20boolean[][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 constant of `boolean` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20long))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long data) Creates a constant containing a single `long` element. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20long[][][][][]))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\]\[\]\[\]\[\]\[\] data) Creates a rank-5 constant of `long` elements. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20long[],%20java.nio.LongBuffer))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\] shape, LongBuffer data) Create a `https://www.tensorflow.org/api_docs/java/org/tensorflow/DataType#INT64` constant with data from the given buffer. |
| static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant#create(org.tensorflow.op.Scope,%20boolean))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean data) Creates a constant containing a single `boolean` element. |

### Inherited Methods

From class [org.tensorflow.op.PrimitiveOp](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp)

|---|---|
| final boolean | [equals](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#equals(java.lang.Object))(Object obj) |
| final int | [hashCode](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#hashCode())() |
| [Operation](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation) | [op](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#op())() Returns the underlying `https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation` |
| final String | [toString](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#toString())() |

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() |

From interface [org.tensorflow.Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)

|---|---|
| abstract [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [asOutput](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand#asOutput())() Returns the symbolic handle of a tensor. |

## Public Methods

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\>
**asOutput**
()

Returns the symbolic handle of a tensor.

Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is
used to obtain a symbolic handle that represents the computation of the input.

<br />

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\]\[\]\[\]\[\] data)

Creates a rank-4 constant of `boolean` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\] data)

Creates a rank-1 constant of `long` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\]\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-6 constant of `double` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float data)

Creates a constant containing a single `float` element.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | The value to put into the new constant. |
|---|---|

##### Returns

- a float constant

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<T\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, Object object, Class\<T\> type)

Create a constant from a Java object.

The argument `object` is first converted into a Tensor using `https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor#create(java.lang.Object)`, so only Objects supported by this method must be
provided. For example:

    Constant.create(scope, new int[]{ {1, 2}, {3, 4} }, Integer.class); // returns a 2x2 integer matrix
     
<br />

<br />

##### Parameters

| scope | is a scope used to add the underlying operation. |
| object | a Java object representing the constant. |
| type |   |
|---|---|

##### Returns

- a constant of type \`type\`

##### See Also

- `https://www.tensorflow.org/api_docs/java/org/tensorflow/Tensor#create(java.lang.Object)`

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\] data)

Creates a constant containing a single `String` element, represented as an array of `byte`s.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. String elements are sequences of bytes from the last array dimension. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\]\[\]\[\] data)

Creates a rank-3 constant of `float` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\] shape, FloatBuffer data)

Create a `https://www.tensorflow.org/api_docs/java/org/tensorflow/DataType#FLOAT` constant with data from the given buffer.

Creates a constant with the given shape by copying elements from the buffer (starting from
its current position) into the tensor. For example, if `shape = {2,3} ` (which represents
a 2x3 matrix) then the buffer must have 6 elements remaining, which will be consumed by this
method.

<br />

##### Parameters

| scope | is a scope used to add the underlying operation. |
| shape | the tensor shape. |
| data | a buffer containing the tensor data. |
|---|---|

##### Returns

- a float constant

##### Throws

| IllegalArgumentException | If the tensor shape is not compatible with the buffer |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\]\[\] data)

Creates a rank-2 constant of `long` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\]\[\]\[\]\[\] data)

Creates a rank-4 constant of `double` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\] shape, DoubleBuffer data)

Create a `https://www.tensorflow.org/api_docs/java/org/tensorflow/DataType#DOUBLE` constant with data from the given buffer.

Creates a constant with the given shape by copying elements from the buffer (starting from
its current position) into the tensor. For example, if `shape = {2,3} ` (which represents
a 2x3 matrix) then the buffer must have 6 elements remaining, which will be consumed by this
method.

<br />

##### Parameters

| scope | is a scope used to add the underlying operation. |
| shape | the tensor shape. |
| data | a buffer containing the tensor data. |
|---|---|

##### Returns

- a double constant

##### Throws

| IllegalArgumentException | If the tensor shape is not compatible with the buffer |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\]\[\]\[\] data)

Creates a rank-3 constant of `int` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-4 constant of `String` elements, each represented as an array of `byte`s.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. String elements are sequences of bytes from the last array dimension. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, String data)

Creates a `String` constant using the default, UTF-8 encoding.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | The string to put into the new constant. |
|---|---|

##### Returns

- a string constant

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-5 constant of `float` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int data)

Creates a constant containing a single `int` element.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | The value to put into the new constant. |
|---|---|

##### Returns

- an integer constant

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\]\[\]\[\]\[\] data)

Creates a rank-3 constant of `String` elements, each represented as an array of `byte`s.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. String elements are sequences of bytes from the last array dimension. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\]\[\] data)

Creates a rank-2 constant of `float` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\]\[\]\[\] data)

Creates a rank-3 constant of `boolean` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\]\[\] data)

Creates a rank-2 constant of `int` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\] shape, IntBuffer data)

Create a `https://www.tensorflow.org/api_docs/java/org/tensorflow/DataType#INT32` constant with data from the given buffer.

Creates a constant with the given shape by copying elements from the buffer (starting from
its current position) into the tensor. For example, if `shape = {2,3} ` (which represents
a 2x3 matrix) then the buffer must have 6 elements remaining, which will be consumed by this
method.

<br />

##### Parameters

| scope | is a scope used to add the underlying operation. |
| shape | the tensor shape. |
| data | a buffer containing the tensor data. |
|---|---|

##### Returns

- an integer constant

##### Throws

| IllegalArgumentException | If the tensor shape is not compatible with the buffer |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\]\[\]\[\]\[\] data)

Creates a rank-4 constant of `float` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\]\[\]\[\] data)

Creates a rank-3 constant of `long` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-5 constant of `int` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, String data, Charset charset)

Creates a `String` constant using a specified encoding.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | The string to put into the new constant. |
| charset | The encoding from String to bytes. |
|---|---|

##### Returns

- a string constant

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\]\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-5 constant of `String` elements, each represented as an array of `byte`s.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. String elements are sequences of bytes from the last array dimension. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\] data)

Creates a rank-1 constant of `float` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Float\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, float\[\]\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-6 constant of `float` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\]\[\]\[\]\[\] data)

Creates a rank-4 constant of `int` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double data)

Creates a constant containing a single `double` element.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | The value to put into the new constant. |
|---|---|

##### Returns

- a double constant

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\]\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-6 constant of `long` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\] data)

Creates a rank-1 constant of `double` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\]\[\]\[\]\[\] data)

Creates a rank-4 constant of `long` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<T\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, Class\<T\> type, long\[\] shape, ByteBuffer data)

Create a constant with data from the given buffer.

Creates a Constant with the provided shape of any type where the constant data has been
encoded into `data` as per the specification of the TensorFlow [C
API](https://www.tensorflow.org/code/tensorflow/c/c_api.h).

<br />

##### Parameters

| scope | is a scope used to add the underlying operation. |
| type | the tensor datatype. |
| shape | the tensor shape. |
| data | a buffer containing the tensor data. |
|---|---|

##### Returns

- a constant of type \`type\`

##### Throws

| IllegalArgumentException | If the tensor datatype or shape is not compatible with the buffer |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\] data)

Creates a rank-1 constant of `int` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\]\[\]\[\] data)

Creates a rank-3 constant of `double` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\] data)

Creates a rank-1 constant of `boolean` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Integer\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, int\[\]\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-6 constant of `int` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\]\[\]\[\] data)

Creates a rank-2 constant of `String` elements, each represented as an array of `byte`s.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. String elements are sequences of bytes from the last array dimension. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\]\[\] data)

Creates a rank-2 constant of `boolean` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\]\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-6 constant of `boolean` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-5 constant of `double` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Double\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, double\[\]\[\] data)

Creates a rank-2 constant of `double` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<String\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, byte\[\]\[\] data)

Creates a rank-1 constant of `String` elements, each represented as an array of `byte`s.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. String elements are sequences of bytes from the last array dimension. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-5 constant of `boolean` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long data)

Creates a constant containing a single `long` element.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | The value to put into the new constant. |
|---|---|

##### Returns

- a long constant

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\]\[\]\[\]\[\]\[\] data)

Creates a rank-5 constant of `long` elements.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | An array containing the values to put into the new constant. The dimensions of the new constant will match those of the array. |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Long\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, long\[\] shape, LongBuffer data)

Create a `https://www.tensorflow.org/api_docs/java/org/tensorflow/DataType#INT64` constant with data from the given buffer.

Creates a constant with the given shape by copying elements from the buffer (starting from
its current position) into the tensor. For example, if `shape = {2,3} ` (which represents
a 2x3 matrix) then the buffer must have 6 elements remaining, which will be consumed by this
method.

<br />

##### Parameters

| scope | is a scope used to add the underlying operation. |
| shape | the tensor shape. |
| data | a buffer containing the tensor data. |
|---|---|

##### Returns

- a long constant

##### Throws

| IllegalArgumentException | If the tensor shape is not compatible with the buffer |
|---|---|

#### public static [Constant](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Constant)\<Boolean\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, boolean data)

Creates a constant containing a single `boolean` element.

##### Parameters

| scope | is a scope used to add the underlying operation. |
| data | The value to put into the new constant. |
|---|---|

##### Returns

- a boolean constant