class_docstr: coremltools internal representation of a torch IR block.
code: def from_torchscript_block(cls, block, parent):
      node_names = set()
      nodes = []
      inputs = []
      outputs = []
  
      # Add inputs
      for inp in block.inputs():
          inputs.append(inp.debugName())
  
      # Add outputs
      for outp in block.outputs():
          outputs.append(outp.debugName())
  
      internal_block = cls(
          parent=parent, inputs=inputs, outputs=outputs, nodes=nodes
      )
  
      # Add nodes
      for raw_node in block.nodes():
          new_node = InternalTorchIRNode.from_torchscript_node(
              node=raw_node, parent=internal_block
          )
          if new_node.name == new_node.kind:
              new_node.name = _find_new_name(new_node.name, node_names)
          internal_block.nodes.append(new_node)
          node_names.add(new_node.name)
  
      return internal_block
  
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 3 for calling the InternalTorchIRBlock obj's underlying member method code with example usage: obj.from_torchscript_block(cls, block, parent) and returns: internal_block