TrainingExtensions/torch/src/python/aimet_torch/meta/connectedgraph.py
def _get_attribute_name(node: torch._C.Node) -> Dict[str, str]:
        """
        Retrieve the attributes associated with the graph node
        :param node: trace graph node
        :return: a dictionary of attributes associated with the node
        """
        attributes = {}
        # node description has pseudo-code of the form  '... torch_mangle_2.Module = prim::GetAttr[name="fc"](%self.1)'
        # for the above example attributeNames() iterator should return a string 'name'
        node_desc = str(node)
        for attribute_name in node.attributeNames():
            pattern = attribute_name + '="'
            if pattern in node_desc:
                attributes[attribute_name] = node_desc.split(pattern)[1].split('"')[0]
        return attributes

        Retrieve the attributes associated with the graph node
        :param node: trace graph node
        :return: a dictionary of attributes associated with the node
        
Retrieve the attributes associated with the graph node
Retrieve the attributes associated with the graph node
def _get_attribute_name(node: torch._C.Node) -> Dict[str, str]:
        attributes = {}
        node_desc = str(node)
        for attribute_name in node.attributeNames():
            pattern = attribute_name + '="'
            if pattern in node_desc:
                attributes[attribute_name] = node_desc.split(pattern)[1].split('"')[0]
        return attributes
def _get_attribute_name ( node : torch . _C . Node ) -> Dict [ str , str ] : attributes = { } node_desc = str ( node ) for attribute_name in node . attributeNames ( ) : pattern = attribute_name + '="' if pattern in node_desc : attributes [ attribute_name ] = node_desc . split ( pattern ) [ 1 ] . split ( '"' ) [ 0 ] return attributes
Retrieve the attributes associated with the graph node
Retrieve the attributes associated with the graph node
"""
        Retrieve the attributes associated with the graph node
        :param node: trace graph node
        :return: a dictionary of attributes associated with the node
        """ # node description has pseudo-code of the form  '... torch_mangle_2.Module = prim::GetAttr[name="fc"](%self.1)' # for the above example attributeNames() iterator should return a string 'name'
a dictionary of attributes associated with the node
a dictionary of attributes associated with the node
node
torch._C.Node
trace graph node
trace graph node