GraphOperationBuilder

public final class GraphOperationBuilder

An OperationBuilder for adding GraphOperations to a Graph.

Public Methods

GraphOperationBuilder
addControlInput(Operation control)
Ensure that the operation does not execute before the control operation does.
GraphOperationBuilder
addInput(Output<?> input)
Add the output of another operation as the next input of the operation being built.
GraphOperationBuilder
addInputList(Output[]<?> inputs)
Add the outputs of another operation as the next inputs of the operation being built.
GraphOperation
build()
Add the GraphOperation being built to the Graph.
GraphOperationBuilder
setAttr(String name, DataType value)
Set the type value of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, String[] value)
Set the string values of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, boolean[] value)
Set the boolean values of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, String value)
Set the string value of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, float[] value)
Set the float values of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, DataType[] value)
Set the type values of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, long value)
Set the long value of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, long[] value)
Set the long values of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, Tensor value)
Set the tensor value of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, boolean value)
Set the boolean value of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, float value)
Set the float value of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, Shape value)
Set the shape value of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, Tensor[] value)
Set the tensor values of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, byte[] value)
Set the byte values of an attribute of the operation being built.
GraphOperationBuilder
setAttr(String name, Shape[] value)
Set the shape values of an attribute of the operation being built.
GraphOperationBuilder
setDevice(String device)
Set the device requested for computing the operation being built.

Inherited Methods

Public Methods

public GraphOperationBuilder addControlInput (Operation control)

Ensure that the operation does not execute before the control operation does.

A control input is an Operation that must be executed before running the operation currently being built.

For example, an Assert operation may be added as a control input for this operation. The Assert now behaves as a pre-condition that will always verify itself before running the operation.

Parameters
control operation that must be executed before running this operation.
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder addInput (Output<?> input)

Add the output of another operation as the next input of the operation being built.

Parameters
input Output supposed to be the input of the operation being built.
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder addInputList (Output[]<?> inputs)

Add the outputs of another operation as the next inputs of the operation being built.

Parameters
inputs list of Output supposed to be the inputs of the operation being built.
Returns
  • the OperationBuilder instance for chaining.

public GraphOperation build ()

Add the GraphOperation being built to the Graph.

The OperationBuilder is not usable after build() returns.

public GraphOperationBuilder setAttr (String name, DataType value)

Set the type value of an attribute of the operation being built.

Parameters
name attribute name
value attribute value
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, String[] value)

Set the string values of an attribute of the operation being built.

Parameters
name attribute name
value attribute values
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, boolean[] value)

Set the boolean values of an attribute of the operation being built.

Parameters
name attribute name
value attribute values
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, String value)

Set the string value of an attribute of the operation being built.

Parameters
name attribute name
value attribute value
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, float[] value)

Set the float values of an attribute of the operation being built.

Parameters
name attribute name
value attribute values
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, DataType[] value)

Set the type values of an attribute of the operation being built.

Parameters
name attribute name
value attribute values
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, long value)

Set the long value of an attribute of the operation being built.

Parameters
name attribute name
value attribute value
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, long[] value)

Set the long values of an attribute of the operation being built.

Parameters
name attribute name
value attribute values
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, Tensor value)

Set the tensor value of an attribute of the operation being built.

Parameters
name attribute name
value attribute value
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, boolean value)

Set the boolean value of an attribute of the operation being built.

Parameters
name attribute name
value attribute value
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, float value)

Set the float value of an attribute of the operation being built.

Parameters
name attribute name
value attribute value
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, Shape value)

Set the shape value of an attribute of the operation being built.

Parameters
name attribute name
value attribute value
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, Tensor[] value)

Set the tensor values of an attribute of the operation being built.

Parameters
name attribute name
value attribute values
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, byte[] value)

Set the byte values of an attribute of the operation being built.

Parameters
name attribute name
value attribute values
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setAttr (String name, Shape[] value)

Set the shape values of an attribute of the operation being built.

Parameters
name attribute name
value attribute values
Returns
  • the OperationBuilder instance for chaining.

public GraphOperationBuilder setDevice (String device)

Set the device requested for computing the operation being built.

Parameters
device the requested device, as a string
Returns
  • the OperationBuilder instance for chaining.