code: def deterministic(
      name: str, value: torch.Tensor, event_dim: Optional[int] = None
  ) -> torch.Tensor:
      """
      Deterministic statement to add a :class:`~pyro.distributions.Delta` site
      with name `name` and value `value` to the trace. This is useful when we
      want to record values which are completely determined by their parents.
      For example::
  
          x = pyro.sample("x", dist.Normal(0, 1))
          x2 = pyro.deterministic("x2", x ** 2)
  
      .. note:: The site does not affect the model density. This currently converts
          to a :func:`sample` statement, but may change in the future.
  
      :param str name: Name of the site.
      :param torch.Tensor value: Value of the site.
      :param int event_dim: Optional event dimension, defaults to `value.ndim`.
      """
      event_dim = value.ndim if event_dim is None else event_dim
      return sample(
          name,
          dist.Delta(value, event_dim=event_dim).mask(False),
          obs=value,
          infer={"_deterministic": True},
      )
  
imports: import copy
  import warnings
  from collections import OrderedDict
  from contextlib import ExitStack, contextmanager
  from inspect import isclass
  from typing import Callable, Iterator, Optional, Sequence, Union
  import torch
  from torch.distributions import constraints
  import pyro.distributions
  import pyro.infer
  import pyro.poutine
  from pyro.distributions.torch_distribution import TorchDistributionMixin
  from pyro.params import param_with_module_name
  from pyro.params.param_store import ParamStoreDict
  from pyro.poutine.plate_messenger import PlateMessenger
  from pyro.poutine.runtime import _MODULE_NAMESPACE_DIVIDER, _PYRO_PARAM_STORE, InferDict, Message, am_i_wrapped, apply_stack, effectful
  from pyro.poutine.subsample_messenger import SubsampleMessenger
  from pyro.util import deep_getattr, set_rng_seed
label_desc: Use image node_id 7 for calling a global function with example usage: deterministic(name, value, event_dim) and returns: sample