afe.backends.mpk.node ===================== .. py:module:: afe.backends.mpk.node .. autoapi-nested-parse:: Functions for making MPK JSON node descriptions. Functions --------- .. autoapisummary:: afe.backends.mpk.node.flatten_tuple afe.backends.mpk.node.get_node_size afe.backends.mpk.node.get_output_node_names afe.backends.mpk.node.get_plugin_input_nodes Module Contents --------------- .. py:function:: flatten_tuple(data: afe.ir.defines.DataValue[_A]) -> List[_A] Convert un-nested tuples to a list. Given a tuple of 0, 2, or more tensors, the tuple elements are returned. Given a tensor, the tensor is returned as a list of 1 item. An exception is raised for other inputs. :param data: Data value :return: Flattened data value .. py:function:: get_node_size(node: afe.ir.node.AwesomeNode) -> int Get node size in bytes. :param node: AwesomeNode :return: Number of bytes. .. py:function:: get_output_node_names(node_name: str, output_type: afe.ir.defines.DataValue[afe.ir.tensor_type.TensorType], output_names: Dict[str, str]) -> afe.ir.defines.DataValue[str] Get the output node names. Check if output node is an output of the model and if it is original model name is added to the ModelSDK name. .. py:function:: get_plugin_input_nodes(input_nodes: List[afe.backends.mpk.defines.InOutNodesMPKData]) -> List[afe.backends.mpk.defines.PluginInputNodeMPKData] Convert a list of MPK JSON nodes to a list of inputs for MLA or EV74 plugin. :param input_node: MPK JSON objects representing inputs to the AwesomeNode. :return: PluginInputNodeMPKData class with input node.