public final class GraphOperationBuilder extends Object implements OperationBuilder
Modifier and Type | Method and Description |
---|---|
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,
boolean value)
Set the boolean value 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,
byte[] value)
Set the byte values of an attribute of the operation being built.
|
GraphOperationBuilder |
setAttr(String name,
DataType value)
Set the type value 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,
float value)
Set the float 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,
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,
Shape value)
Set the shape value 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 |
setAttr(String name,
String value)
Set the string 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,
Tensor<?> value)
Set the tensor 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 |
setDevice(String device)
Set the device requested for computing the operation being built.
|
public GraphOperation build()
GraphOperation
being built to the Graph
.
The OperationBuilder is not usable after build() returns.
build
in interface OperationBuilder
public GraphOperationBuilder addControlInput(Operation control)
OperationBuilder
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.
addControlInput
in interface OperationBuilder
control
- operation that must be executed before running this operation.public GraphOperationBuilder addInput(Output<?> input)
OperationBuilder
addInput
in interface OperationBuilder
input
- Output
supposed to be the input of the operation being built.public GraphOperationBuilder addInputList(Output<?>[] inputs)
OperationBuilder
addInputList
in interface OperationBuilder
inputs
- list of Output
supposed to be the inputs of the operation being built.public GraphOperationBuilder setDevice(String device)
OperationBuilder
setDevice
in interface OperationBuilder
device
- the requested device, as a stringpublic GraphOperationBuilder setAttr(String name, String value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuepublic GraphOperationBuilder setAttr(String name, byte[] value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuespublic GraphOperationBuilder setAttr(String name, long value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuepublic GraphOperationBuilder setAttr(String name, long[] value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuespublic GraphOperationBuilder setAttr(String name, float value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuepublic GraphOperationBuilder setAttr(String name, float[] value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuespublic GraphOperationBuilder setAttr(String name, boolean value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuepublic GraphOperationBuilder setAttr(String name, boolean[] value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuespublic GraphOperationBuilder setAttr(String name, DataType value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuepublic GraphOperationBuilder setAttr(String name, DataType[] value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuespublic GraphOperationBuilder setAttr(String name, Tensor<?> value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuepublic GraphOperationBuilder setAttr(String name, Tensor<?>[] value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuespublic GraphOperationBuilder setAttr(String name, Shape value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuepublic GraphOperationBuilder setAttr(String name, Shape[] value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuespublic GraphOperationBuilder setAttr(String name, String[] value)
OperationBuilder
setAttr
in interface OperationBuilder
name
- attribute namevalue
- attribute valuesCopyright © 2022. All rights reserved.