# GraphOperation

public final class **GraphOperation**
Implementation for an
`
https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Operation
`
added as a node to a
`
https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Graph
`
.


GraphOperation instances are valid only as long as the
`
https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Graph
`
they are a part of is
valid. Thus, if
`
https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Graph#close()
`
has been invoked, then methods on the GraphOperation
instance may fail with an
`
IllegalStateException
`
.


GraphOperation instances are immutable and thread-safe.

<br />

<br />

### Public Methods

|---|---|
| boolean | [equals](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/GraphOperation#equals(java.lang.Object)) (Object o) |
| int | [hashCode](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/GraphOperation#hashCode()) () |
| int | [inputListLength](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/GraphOperation#inputListLength(java.lang.String)) (String name) Returns the size of the given inputs list of Tensors for this operation. |
| String | [name](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/GraphOperation#name()) () Returns the full name of the Operation. |
| int | [numOutputs](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/GraphOperation#numOutputs()) () Returns the number of tensors produced by this operation. |
| \<T\> [Output](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Output) \<T\> | [output](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/GraphOperation#output(int)) (int idx) Returns a symbolic handle to one of the tensors produced by this operation. |
| [Output\[\]](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Output) \<?\> | [outputList](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/GraphOperation#outputList(int, int)) (int idx, int length) Returns symbolic handles to a list of tensors produced by this operation. |
| int | [outputListLength](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/GraphOperation#outputListLength(java.lang.String)) (String name) Returns the size of the list of Tensors produced by this operation. |
| String | [toString](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/GraphOperation#toString()) () |
| String | [type](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/GraphOperation#type()) () Returns the type of the operation, i.e., the name of the computation performed by the operation. |

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

From interface [org.tensorflow.Operation](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Operation)

|---|---|
| abstract int | [inputListLength](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Operation#inputListLength(java.lang.String)) (String name) Returns the size of the given inputs list of Tensors for this operation. |
| abstract String | [name](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Operation#name()) () Returns the full name of the Operation. |
| abstract int | [numOutputs](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Operation#numOutputs()) () Returns the number of tensors produced by this operation. |
| abstract \<T\> [Output](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Output) \<T\> | [output](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Operation#output(int)) (int idx) Returns a symbolic handle to one of the tensors produced by this operation. |
| abstract [Output\[\]](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Output) \<?\> | [outputList](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Operation#outputList(int, int)) (int idx, int length) Returns symbolic handles to a list of tensors produced by this operation. |
| abstract int | [outputListLength](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Operation#outputListLength(java.lang.String)) (String name) Returns the size of the list of Tensors produced by this operation. |
| abstract String | [type](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Operation#type()) () Returns the type of the operation, i.e., the name of the computation performed by the operation. |

## Public Methods


#### public boolean
**equals**
(Object o)


#### public int
**hashCode**
()


#### public int
**inputListLength**
(String name)


Returns the size of the given inputs list of Tensors for this operation.


An Operation has multiple named inputs, each of which contains either a single tensor or a
list of tensors. This method returns the size of the list of tensors for a specific named input
of the operation.

<br />

##### Parameters

| name | identifier of the list of tensors (of which there may be many) inputs to this operation. |
|---|---|

##### Returns

- the size of the list of Tensors produced by this named input.

#### public String
**name**
()


Returns the full name of the Operation.

#### public int
**numOutputs**
()


Returns the number of tensors produced by this operation.

#### public [Output](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Output) \<T\>
**output**
(int idx)


Returns a symbolic handle to one of the tensors produced by this operation.


Warning: Does not check that the type of the tensor matches T. It is recommended to call
this method with an explicit type parameter rather than letting it be inferred, e.g.
`
operation.<Integer>output(0)
`

<br />

##### Parameters

| idx | The index of the output among the outputs produced by this operation. |
|---|---|


#### public [Output\[\]](https://www.tensorflow.org/versions/r2.6/api_docs/java/org/tensorflow/Output) \<?\>
**outputList**
(int idx, int length)


Returns symbolic handles to a list of tensors produced by this operation.

##### Parameters

| idx | index of the first tensor of the list |
| length | number of tensors in the list |
|---|---|

##### Returns

- array of `
  Output
  `

#### public int
**outputListLength**
(String name)


Returns the size of the list of Tensors produced by this operation.


An Operation has multiple named outputs, each of which produces either a single tensor or a
list of tensors. This method returns the size of the list of tensors for a specific named
output of the operation.

<br />

##### Parameters

| name | identifier of the list of tensors (of which there may be many) produced by this operation. |
|---|---|

##### Returns

- the size of the list of Tensors produced by this named output.

#### public String
**toString**
()


#### public String
**type**
()


Returns the type of the operation, i.e., the name of the computation performed by the
operation.