afe.ir.node
Classes
An awesome node is responsible for storing attributes and operations used by the AwesomeNet when |
Functions
|
Return True is the AwesomeNode contains a SiMa IR |
|
Return True is the AwesomeNode contains a SiMa IR |
|
Return True is the AwesomeNode contains a Constant SiMaIR |
|
Return True is the AwesomeNode contains a Placeholder SiMaIR |
|
Return True is the AwesomeNode contains a AwesomeNet |
|
Return True is the AwesomeNode contains a External Graph |
|
Return True if the AwesomeNode is an EV node. |
|
|
|
|
|
|
|
Return True is the AwesomeNode contains a sub-graph. |
|
Return True is the AwesomeNode contains a Tuple. |
|
Return True is the AwesomeNode contains a TupleGetItem. |
|
Return True is the AwesomeNode contains an Unpack transform. |
|
Return True if AwesomeNode's output type is floating point. |
|
Return True if the AwesomeNode contains Pool operator. |
|
Return True if the AwesomeNode contains Requantize operator. |
|
Return True if node uses calibration information during quantization. |
|
Generates a dictionary using the keys from a node's input_names and the values corresponding |
Module Contents
- class afe.ir.node.AwesomeNode[source]
An awesome node is responsible for storing attributes and operations used by the AwesomeNet when executing the network
- Parameters:
name – Name of the node
input_names – Parameter names of this AwesomeNode. These represent the inputs expected by the code inside this node.
input_node_names – Argument names of this AwesomeNode. These represent the inputs supplied by the net that contains this node. Data for each argument gets forwarded to the corresponding parameter.
ir – Union[SiMaIR, “afe.ir.net.AwesomeNet”, “afe.backends.BackendIR”]. The IR can be: * SiMaIR - A frontend IR that contains single operation or ExternalOp * AwesomeNet - A frontend IR that contains a sub-graph that can be supported by SiMa’s backends * BackendIR - A backend IR that can be compiled, or already compiled by certain backend
_status – Status. Node status. Default is Status.RELAY
_layer_stats – Layer statistics. For each MLA node, quantization error is calculated, that information is than forwarded to .sima.json file, and it can be viewed in Netron.
- property status: afe.ir.defines.Status[source]
- set_batch_size(batch_size: int)[source]
Modifies AwesomeNode’s internal parameters to accommodate for a given batch size.
- Parameters:
batch_size – Integer value representing the batch size of the inputs to the AwesomeNet.
- update_layer_stats(layer_stats: afe.ir.defines.LayerStats)[source]
- property layer_stats: afe.ir.defines.LayerStats[source]
- afe.ir.node.node_is_sima_ir(node: AwesomeNode) bool [source]
Return True is the AwesomeNode contains a SiMa IR
- Parameters:
node – AwesomeNode
- afe.ir.node.node_is_backend_ir(node: AwesomeNode) bool [source]
Return True is the AwesomeNode contains a SiMa IR
- Parameters:
node – AwesomeNode
- afe.ir.node.node_is_constant(node: AwesomeNode) bool [source]
Return True is the AwesomeNode contains a Constant SiMaIR
- Parameters:
node – AwesomeNode
- afe.ir.node.node_is_placeholder(node: AwesomeNode) bool [source]
Return True is the AwesomeNode contains a Placeholder SiMaIR
- Parameters:
node – AwesomeNode
- afe.ir.node.node_is_awesomenet(node: AwesomeNode) bool [source]
Return True is the AwesomeNode contains a AwesomeNet
- Parameters:
node – AwesomeNode
- afe.ir.node.node_is_external(node: AwesomeNode) bool [source]
Return True is the AwesomeNode contains a External Graph
- Parameters:
node – AwesomeNode
- afe.ir.node.node_is_ev(node: AwesomeNode) bool [source]
Return True if the AwesomeNode is an EV node.
- Parameters:
node – AwesomeNode
- afe.ir.node.node_is_relu(node: AwesomeNode) bool [source]
- afe.ir.node.node_is_mean(node: AwesomeNode) bool [source]
- afe.ir.node.node_is_upsampling(node: AwesomeNode) bool [source]
- afe.ir.node.node_is_subgraph(node: AwesomeNode) bool [source]
Return True is the AwesomeNode contains a sub-graph.
Parameters
- param node:
AwesomeNode
Return
- return:
bool
- afe.ir.node.node_is_tuple(node: AwesomeNode) bool [source]
Return True is the AwesomeNode contains a Tuple.
Parameters
- param node:
AwesomeNode
Return
- return:
bool
- afe.ir.node.node_is_tuple_get_item(node: AwesomeNode) bool [source]
Return True is the AwesomeNode contains a TupleGetItem.
Parameters
- param node:
AwesomeNode
Return
- return:
bool
- afe.ir.node.node_is_unpack(node: AwesomeNode) bool [source]
Return True is the AwesomeNode contains an Unpack transform.
Parameters
- param node:
AwesomeNode
Return
- return:
bool
- afe.ir.node.node_is_fp32_node(node: AwesomeNode) bool [source]
Return True if AwesomeNode’s output type is floating point.
- Parameters:
node – AwesomeNode to be analyzed.
- Returns:
bool. True if AwesomeNode’s output type is fp32, otherwise False.
- afe.ir.node.node_is_pool_node(node: AwesomeNode) bool [source]
Return True if the AwesomeNode contains Pool operator.
- Parameters:
node – AwesomeNode to be analyzed.
- Returns:
bool. True if the AwesomeNode’s operator is Pooling operator (MaxPool, AvgPool).
- afe.ir.node.node_is_requantization_node(node: AwesomeNode) bool [source]
Return True if the AwesomeNode contains Requantize operator.
- Parameters:
node – AwesomeNode to be analyzed.
- Returns:
bool. True if the AwesomeNode’s operator is Requantize operator.
- afe.ir.node.node_uses_observer(node: AwesomeNode) bool [source]
Return True if node uses calibration information during quantization.
- Parameters:
node – AwesomeNode to be analyzed.
- Returns:
bool. True if AwesomeNode uses calibration information during quantization. Otherwise, quantization information is obtained using quantization from its input node(s).
- afe.ir.node.get_node_inputs(node: AwesomeNode, node_outputs: Dict[afe.ir.defines.NodeName, Any]) Dict[afe.ir.defines.NodeName, Any] [source]
Generates a dictionary using the keys from a node’s input_names and the values corresponding to the data of nodes whose names are in the node’s input_node_names.
- Parameters:
node – The AwesomeNode we are gathering inputs for.
node_outputs – Dictionary containing outputs from other nodes from across the network.
- Returns:
A dictionary containing node inputs.