def load(
    spec: Union[RecursiveScriptModule, "ExportedProgram", str],
    inputs: List[TensorType],
    specification_version: int,
    debug: bool = False,
    outputs: Optional[List[TensorType]] = None,
    cut_at_symbols: Optional[List[str]] = None,
    use_default_fp16_io: bool = False,
    states: Optional[List[StateType]] = None,
    **kwargs
) -> Program:
    """
    Convert PyTorch model to mil CoreML format.

    Parameters
    ----------
    spec: It could be one of the following:
        - String path to .pt file containing serialized torchscript model
        - In memory TorchScript model of type torch.jit.ScriptModule
        - In memory EXIR program of type ExportedProgram
    inputs: Can be a singular element or list of elements of the following form
        1. Any subclass of InputType
        2. torch.Tensor (only shape and dtype will be used)
        3. list of (1. or 2.)
        Inputs are parsed in the flattened order that the model accepts them.
        If names are not specified: input keys for calling predict on the converted model
        will be internal symbols of the input to the graph.
        User can specify a subset of names.
    debug: bool, optional. Defaults to False.
        This flag should generally be False except for debugging purposes
        for diagnosing conversion errors. Setting this flag to True will
        print the list of supported and unsupported ops found in the model
        if conversion fails due to an unsupported op.
    outputs (optional): list[ct.InputType] or None
        list of either ct.TensorTypes or ct.ImageTypes (both of which are child classes of InputType)
        This is the value of the "outputs" argument, passed on by the user in "coremltools.convert" API.
    cut_at_symbols (optional): List of internal symbol name strings. Graph conversion will
        terminate once these symbols have been generated. For debugging use
        only.
    use_default_fp16_io (optional): bool. Defaults to False.
        When minimum_deployment_target set >= ct.target.iOS16 (the same as ct.target.macOS13),
        and the compute precision set to fp16, this flag is True.
        When True, fp32 i/o defaults to fp16.
    """

    if _HAS_TORCH_EXPORT_API and isinstance(spec, ExportedProgram):
        model = spec
    else:
        model = _torchscript_from_spec(spec)

    converter = TorchConverter(
        model,
        inputs,
        outputs,
        cut_at_symbols,
        specification_version,
        use_default_fp16_io,
        states,
    )

    return _perform_torch_convert(converter, debug)

    Convert PyTorch model to mil CoreML format.

    Parameters
    ----------
    spec: It could be one of the following:
        - String path to .pt file containing serialized torchscript model
        - In memory TorchScript model of type torch.jit.ScriptModule
        - In memory EXIR program of type ExportedProgram
    inputs: Can be a singular element or list of elements of the following form
        1. Any subclass of InputType
        2. torch.Tensor (only shape and dtype will be used)
        3. list of (1. or 2.)
        Inputs are parsed in the flattened order that the model accepts them.
        If names are not specified: input keys for calling predict on the converted model
        will be internal symbols of the input to the graph.
        User can specify a subset of names.
    debug: bool, optional. Defaults to False.
        This flag should generally be False except for debugging purposes
        for diagnosing conversion errors. Setting this flag to True will
        print the list of supported and unsupported ops found in the model
        if conversion fails due to an unsupported op.
    outputs (optional): list[ct.InputType] or None
        list of either ct.TensorTypes or ct.ImageTypes (both of which are child classes of InputType)
        This is the value of the "outputs" argument, passed on by the user in "coremltools.convert" API.
    cut_at_symbols (optional): List of internal symbol name strings. Graph conversion will
        terminate once these symbols have been generated. For debugging use
        only.
    use_default_fp16_io (optional): bool. Defaults to False.
        When minimum_deployment_target set >= ct.target.iOS16 (the same as ct.target.macOS13),
        and the compute precision set to fp16, this flag is True.
        When True, fp32 i/o defaults to fp16.
    
coremltools/converters/mil/frontend/torch/load.py