code: def allow_ops_in_compiled_graph():
      if hasattr(torch, "__version__") and torch.__version__[0] < "2":
          # torch._dynamo and torch.compile appear in pytorch 2.0
          return
      try:
          from torch._dynamo import allow_in_graph
      except ImportError:
          warnings.warn(
              "allow_ops_in_compiled_graph failed to import torch: ensure pytorch >=2.0",
              ImportWarning,
          )
          return
  
      from .einops import rearrange, reduce, repeat, einsum
      from .packing import pack, unpack
  
      allow_in_graph(rearrange)
      allow_in_graph(reduce)
      allow_in_graph(repeat)
      allow_in_graph(einsum)
      allow_in_graph(pack)
      allow_in_graph(unpack)
  
      # CF: https://github.com/pytorch/pytorch/blob/2df939aacac68e9621fbd5d876c78d86e72b41e2/torch/_dynamo/__init__.py#L222
      global _ops_were_registered_in_torchdynamo
      _ops_were_registered_in_torchdynamo = True
  
file_path: einops/einops/_torch_specific.py
imports: import warnings
  from typing import Dict, List, Tuple
  import torch
  from einops.einops import TransformRecipe, _reconstruct_from_shape_uncached
label_desc: Use image node_id 2 for calling a global function with example usage: allow_ops_in_compiled_graph() without return types