def from_torchscript(cls, torchscript, inputs=None, cut_at_symbols=None):
        """
        Arguments:
            torchscript: TorchScript object representing the model to convert.
            inputs: A list of input types to the graph.
            cut_at_symbols: The list of desired outputs from the graph. Symbols
                must be present in the graph. For debugging use only.
        """
        assert isinstance(
            torchscript, torch.jit.ScriptModule
        ), f"Input should be an object of type torch.jit.ScriptModule. Provide: {type(torchscript)}"

        if hasattr(torchscript, "training") and torchscript.training:
            logger.warning(
                "Model is not in eval mode. "
                "Consider calling '.eval()' on your model prior to conversion"
            )
        if type(torchscript) == torch.jit._script.RecursiveScriptModule:
            logger.warning(
                "Support for converting Torch Script Models is experimental. "
                "If possible you should use a traced model for conversion."
            )

        nodes = []
        inputs_name_to_type = OrderedDict()

        raw_graph, params, buffers = _expand_and_optimize_ir(torchscript)

        # Add inputs
        # The first element of the raw_graph.inputs() is the 'self' of the module, which is not used.
        graph_inputs = list(raw_graph.inputs())[1:]
        if len(graph_inputs) != len(inputs):
            raise ValueError(
                f"Number of TorchScript inputs ({len(graph_inputs)}) must match the user provided inputs ({len(inputs)})."
            )
        for index, _input in enumerate(graph_inputs):
            name = _input.debugName()
            inputs_name_to_type[name] = inputs[index]

        # Add outputs, cutting if @cut_at_symbols is set
        if cut_at_symbols is not None:
            outputs = cut_at_symbols
        else:
            outputs = [x.debugName() for x in raw_graph.outputs()]

        internal_graph = cls(
            nodes=nodes,
            params=params,
            inputs=inputs_name_to_type,
            outputs=outputs,
            buffers=buffers,
        )

        # Add nodes
        node_names = set()
        for raw_node in raw_graph.nodes():
            new_node = InternalTorchIRNode.from_torchscript_node(
                node=raw_node, parent=internal_graph
            )
            if new_node.name == new_node.kind:
                new_node.name = _find_new_name(new_node.name, node_names)
            internal_graph.nodes.append(new_node)
            node_names.add(new_node.name)

        internal_graph._cache_model_hierarchy_for_params()

        return internal_graph

        Arguments:
            torchscript: TorchScript object representing the model to convert.
            inputs: A list of input types to the graph.
            cut_at_symbols: The list of desired outputs from the graph. Symbols
                must be present in the graph. For debugging use only.
        
coremltools/converters/mil/frontend/torch/internal_graph.py