GraphOperation

public final class GraphOperation

Implementation for an Operation added as a node to a Graph.

GraphOperation 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 GraphOperation instance may fail with an IllegalStateException.

GraphOperation instances are immutable and thread-safe.

Public Methods

Graph
env()
Returns the execution environment this operation was created in.
boolean
equals(Object o)
int
int
inputListLength(String name)
Returns the size of the given inputs list of Tensors for this operation.
String
name()
Returns the full name of the Operation.
int
numOutputs()
Returns the number of tensors produced by this operation.
<T extends TType> Output<T>
output(int idx)
Returns a symbolic handle to one of the tensors produced by this operation.
Output[]<?>
outputList(int idx, int length)
Returns symbolic handles to a list of tensors produced by this operation.
int
outputListLength(String name)
Returns the size of the list of Tensors produced by this operation.
String
String
type()
Returns the type of the operation, i.e., the name of the computation performed by the operation.

Inherited Methods

Public Methods

public Graph env ()

Returns the execution environment this operation was created in.

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.

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

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

public 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.

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.