TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
onnx_graphsurgeon.ir.node.Node Class Reference
Inheritance diagram for onnx_graphsurgeon.ir.node.Node:
Collaboration diagram for onnx_graphsurgeon.ir.node.Node:

Public Member Functions

def __init__ (self, str op, str name=None, Dict[str, object] attrs=None, List["Tensor"] inputs=None, List["Tensor"] outputs=None)
 
def i (self, tensor_idx=0, producer_idx=0)
 
def o (self, consumer_idx=0, tensor_idx=0)
 
def __setattr__ (self, name, value)
 
def copy (self, List["Tensor"] inputs=None, List["Tensor"] outputs=None)
 
def __str__ (self)
 
def __repr__ (self)
 
def __eq__ (self, other)
 

Public Attributes

 op
 
 name
 
 attrs
 
 inputs
 
 outputs
 

Constructor & Destructor Documentation

◆ __init__()

def onnx_graphsurgeon.ir.node.Node.__init__ (   self,
str  op,
str  name = None,
Dict[str, object attrs = None,
List["Tensor"]  inputs = None,
List["Tensor"]  outputs = None 
)
A node represents an operation in a graph, and consumes zero or more Tensors, and produces zero or more Tensors.

Args:
    op (str): The operation this node performs.

    name (str): The name of this node.
    attrs (Dict[str, object]): A dictionary that maps attribute names to their values.
    inputs (List[Tensor]): A list of zero or more input Tensors.
    outputs (List[Tensor]): A list of zero or more output Tensors.

Member Function Documentation

◆ i()

def onnx_graphsurgeon.ir.node.Node.i (   self,
  tensor_idx = 0,
  producer_idx = 0 
)
Convenience function to get a producer node of one of this node's input tensors.
Note that the parameters are swapped compared to the o() function; this is because tensors are likely to have only a single producer

For example:
::

    assert node.i() == node.inputs[0].inputs[0]
    assert node.i(1, 2) == node.inputs[1].inputs[2]

Args:
    tensor_idx (int): The index of the input tensor of this node. Defaults to 0.
    producer_idx (int): The index of the producer of the input tensor, if the tensor has multiple producers. Defaults to 0

Returns:
    Node: The specified producer (input) node.

◆ o()

def onnx_graphsurgeon.ir.node.Node.o (   self,
  consumer_idx = 0,
  tensor_idx = 0 
)
Convenience function to get a consumer node of one of this node's output tensors.

For example:
::

    assert node.o() == node.outputs[0].outputs[0]
    assert node.o(2, 1) == node.outputs[1].outputs[2]

Args:
    consumer_idx (int): The index of the consumer of the input tensor. Defaults to 0.
    tensor_idx (int): The index of the output tensor of this node, if the node has multiple outputs. Defaults to 0.

Returns:
    Node: The specified consumer (output) node

◆ __setattr__()

def onnx_graphsurgeon.ir.node.Node.__setattr__ (   self,
  name,
  value 
)

◆ copy()

def onnx_graphsurgeon.ir.node.Node.copy (   self,
List["Tensor"]  inputs = None,
List["Tensor"]  outputs = None 
)
Makes a shallow copy of this node, overriding input and output information.

Note: Generally, you should only ever make a deep copy of a Graph.

◆ __str__()

def onnx_graphsurgeon.ir.node.Node.__str__ (   self)
Here is the caller graph for this function:

◆ __repr__()

def onnx_graphsurgeon.ir.node.Node.__repr__ (   self)
Here is the call graph for this function:

◆ __eq__()

def onnx_graphsurgeon.ir.node.Node.__eq__ (   self,
  other 
)
Check whether two nodes are equal by comparing name, attributes, op, inputs, and outputs.

Member Data Documentation

◆ op

onnx_graphsurgeon.ir.node.Node.op

◆ name

onnx_graphsurgeon.ir.node.Node.name

◆ attrs

onnx_graphsurgeon.ir.node.Node.attrs

◆ inputs

onnx_graphsurgeon.ir.node.Node.inputs

◆ outputs

onnx_graphsurgeon.ir.node.Node.outputs

The documentation for this class was generated from the following file: