GraphNode
Setting an Operation
- Function
Sets the node operation.
- Prototype
GraphNode.SetOperation (op: operation) -> torch_atb.GraphNode
- Parameter
atb::operation
- Notice
If the API fails to be called, an exception is thrown and the API stops running.
Obtaining the Node outTensor
- Function
Obtains the node outTensor.
- Prototype
GraphNode.GetOutput (index: size_t) -> torch_atb.GraphNode
- Parameter
index
- Return Value
string
- Notice
If the API fails to be called, an exception is thrown and the API stops running.
- Example
1 2 3
# layer1 is the node added to the computational graph. layer1 = builder.add_node([x, y], elewise_add) add_out = layer1.get_output(0)
Setting a Node Stream ID
- Function
Sets a node stream ID.
- Prototype
GraphNode.SetStreamId (streamId: uint32_t) -> torch_atb.GraphNode
- Parameter
streamId
- Notice
If the API fails to be called, an exception is thrown and the API stops running.
- Example
1 2
# layer1 is the node added to the computational graph. layer1.set_stream_id(1)
Obtaining the Node Stream ID
- Function
Obtains the node stream ID.
- Prototype
GraphNode.GetStreamId () -> torch_atb.GraphNode
- Return Value
streamId
- Notice
If the API fails to be called, an exception is thrown and the API stops running.
- Example
1 2
# layer1 is the node added to the computational graph. id = layer1.get_stream_id(1)
Parent topic: Graph API