class_docstr: coremltools internal representation of a torch IR node.
  Can construct itself from a provided torchIR node or manually constructed with
  args for testing.
  
  See InternalTorchIRGraph for the motivation behind this structure.
code: def from_torchscript_node(cls, node, parent):
      inputs = [_input.debugName() for _input in node.inputs()]
      outputs = [output.debugName() for output in node.outputs()]
      namespace = node.kind().split("::")[0].lower()
      if namespace in _DEFAULT_OP_NAMESPACES:
          # We conventionally skip the aten/prim namespaces in our naming.
          kind = node.kind().split("::")[-1].lower()
      else:
          kind = node.kind().lower()
  
      attr = {
          name: getattr(node, node.kindOf(name))(name)
          for name in node.attributeNames()
      }
      if "value" not in attr:
          attr["value"] = None
      # If the output is boolean, explicitly cast it so type inference
      # will work correctly.
      if (
          len(outputs) == 1
          and next(node.outputs()).type().str() == "bool"
      ):
          attr["value"] = bool(attr["value"])
  
      # On rare occassions, a node has no outputs. In that case, the node's
      # On rare occasions, a node has no outputs. In that case, the node's
      # name will be its kind. However, this no longer guarantees the node's
      # name is unique. It will be up to the graph constructing the node to
      # make sure names are unique.
      name = outputs[0] if len(outputs) > 0 else kind
  
      internal_node = cls(
          name=name,
          kind=kind,
          parent=parent,
          inputs=inputs,
          outputs=outputs,
          attr=attr,
          blocks=None,
      )
      internal_node.blocks = [
          InternalTorchIRBlock.from_torchscript_block(
              block=b, parent=internal_node
          )
          for b in node.blocks()
      ]
      return internal_node
  
imports: from collections import OrderedDict
  import torch
  from torch.fx.node import Node
  from coremltools import _logger
  from .edgeir_utils import extract_inputs_from_edge_program
  from .torchscript_utils import _expand_and_optimize_ir
label_desc: Use image node_id 2 for calling the InternalTorchIRNode obj's underlying member method code with example usage: obj.from_torchscript_node(cls, node, parent) and returns: internal_node