code: def fakify(mode, t, t_constraints, source, sources):
      """
      Make a fake tensor, given a fake mode, a tensor, constraints indexed
      by tensor ids, the source for the tensor, and an accumulator mapping
      tensor dimensions to their sources.
      """
      n_dims = len(t.shape)
      symbolic_context = StatelessSymbolicContext(
          dynamic_sizes=[DimDynamic.STATIC] * n_dims,
          constraint_sizes=[None] * n_dims,
      )
      t_id = id(t)
      if t_id in t_constraints:
          for i, constraint in t_constraints[t_id].items():
              symbolic_context.constraint_sizes[
                  i
              ] = constraint.constraint_range
              symbolic_context.dynamic_sizes[i] = DimDynamic.DYNAMIC
              src = TensorPropertySource(
                  base=source, prop=TensorProperty.SIZE, idx=i
              )
              sources[(t_id, i)] = src
              mode.shape_env.source_name_to_debug_name[
                  src.name()
              ] = constraint.debug_name
      fake = mode.from_tensor(
          t, source=source, symbolic_context=symbolic_context
      )
      mode.shape_env.tracked_fakes.append(
          TrackedFake(fake, source, symbolic_context)
      )
      return fake
  
file_path: pytorch/torch/_export/non_strict_utils.py
imports: import inspect
  from collections import defaultdict
  from typing import Dict, Tuple
  import torch
  from torch._dynamo.source import GetItemSource, LocalSource, TensorProperty, TensorPropertySource
  from torch._dynamo.variables.builder import TrackedFake
  from torch._export.passes.add_runtime_assertions_for_constraints_pass import InputDim
  from torch._guards import Source
  from torch._subclasses.fake_tensor import FakeTensorMode
  from torch.export import Constraint
  from torch.fx.experimental.symbolic_shapes import ConstraintViolationError, DimDynamic, EqualityConstraint, ShapeEnv, StatelessSymbolicContext
label_desc: Use image node_id 1 for calling a global function with example usage: fakify(mode, t, t_constraints, source, sources) and returns: fake