Operation

public final class Operation

A Graph node that performs computation on Tensors.

An Operation is a node in a Graph that takes zero or more Tensors (produced by other Operations in the Graph) as input, and produces zero or more Tensors as output.

Operation instances are valid only as long as the Graph they are a part of is valid. Thus, if close() has been invoked, then methods on the Operation instance may fail with an IllegalStateException.

Operation instances are immutable and thread-safe.

Public Methods

String
name()
Returns the full name of the Operation.
int
numOutputs()
Returns the number of tensors produced by this operation.
Output
output(int idx)
Returns a symbolic handle to one of the tensors produced by this operation.
int
outputListLength(String name)
Returns the size of the list of Tensors produced by this operation.
String
type()
Returns the type of the operation, i.e., the name of the computation performed by the operation.

Inherited Methods

Public Methods

public String name ()

Returns the full name of the Operation.

public int numOutputs ()

Returns the number of tensors produced by this operation.

public Output output (int idx)

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

Parameters
idx

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.

Parameters
name identifier of the list of tensors (of which there may be many) produced by this operation.
Throws
IllegalArgumentException if this operation has no output with the provided name.

public String type ()

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