code: def save(
      ep: ExportedProgram,
      f: Union[str, os.PathLike, io.BytesIO],
      *,
      extra_files: Optional[Dict[str, Any]] = None,
      opset_version: Optional[Dict[str, int]] = None,
  ) -> None:
      """
  
      .. warning::
          Under active development, saved files may not be usable in newer versions
          of PyTorch.
  
      Saves an :class:`ExportedProgram` to a file-like object. It can then be
      loaded using the Python API :func:`torch.export.load <torch.export.load>`.
  
      Args:
          ep (ExportedProgram): The exported program to save.
  
          f (Union[str, os.PathLike, io.BytesIO): A file-like object (has to
           implement write and flush) or a string containing a file name.
  
          extra_files (Optional[Dict[str, Any]]): Map from filename to contents
           which will be stored as part of f.
  
          opset_version (Optional[Dict[str, int]]): A map of opset names
           to the version of this opset
  
  
      Example::
  
          import torch
          import io
  
          class MyModule(torch.nn.Module):
              def forward(self, x):
                  return x + 10
  
          ep = torch.export.export(MyModule(), (torch.randn(5),))
  
          # Save to file
          torch.export.save(ep, 'exported_program.pt2')
  
          # Save to io.BytesIO buffer
          buffer = io.BytesIO()
          torch.export.save(ep, buffer)
  
          # Save with extra files
          extra_files = {'foo.txt': b'bar'.decode('utf-8')}
          torch.export.save(ep, 'exported_program.pt2', extra_files=extra_files)
  
      """
      from torch._export import save
  
      save(ep, f, extra_files=extra_files, opset_version=opset_version)
  
imports: import builtins
  import copy
  import dataclasses
  import inspect
  import io
  import os
  import sys
  import typing
  import warnings
  from enum import auto, Enum
  from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, TYPE_CHECKING, Union
  import torch
  import torch.fx._pytree
  import torch.utils._pytree
  from torch.fx._compatibility import compatibility
  from torch.fx.passes.infra.pass_base import PassResult
  from torch.fx.passes.infra.pass_manager import PassManager
  from torch.utils._pytree import FlattenFunc, FromDumpableContextFn, ToDumpableContextFn, UnflattenFunc
  from .dynamic_shapes import Constraint, Dim, dims, dynamic_dim
  from .exported_program import ExportedProgram, ModuleCallEntry, ModuleCallSignature
  from .graph_signature import ExportBackwardSignature, ExportGraphSignature
  from .unflatten import FlatArgsAdapter, unflatten, UnflattenedModule
label_desc: Use image node_id 2 for calling a global function with example usage: save(ep, f) without return types