code: def param(
      name: str,
      init_tensor: Union[
          torch.Tensor, Callable[[], torch.Tensor], None
      ] = None,
      constraint: constraints.Constraint = constraints.real,
      event_dim: Optional[int] = None,
  ) -> torch.Tensor:
      """
      Saves the variable as a parameter in the param store.
      To interact with the param store or write to disk,
      see `Parameters <parameters.html>`_.
  
      :param str name: name of parameter
      :param init_tensor: initial tensor or lazy callable that returns a tensor.
          For large tensors, it may be cheaper to write e.g.
          ``lambda: torch.randn(100000)``, which will only be evaluated on the
          initial statement.
      :type init_tensor: torch.Tensor or callable
      :param constraint: torch constraint, defaults to ``constraints.real``.
      :type constraint: torch.distributions.constraints.Constraint
      :param int event_dim: (optional) number of rightmost dimensions unrelated
          to batching. Dimension to the left of this will be considered batch
          dimensions; if the param statement is inside a subsampled plate, then
          corresponding batch dimensions of the parameter will be correspondingly
          subsampled. If unspecified, all dimensions will be considered event
          dims and no subsampling will be performed.
      :returns: A constrained parameter. The underlying unconstrained parameter
          is accessible via ``pyro.param(...).unconstrained()``, where
          ``.unconstrained`` is a weakref attribute.
      :rtype: torch.Tensor
      """
      # Note effectful(-) requires the double passing of name below.
      args = (name,) if init_tensor is None else (name, init_tensor)
      value = _param(
          *args, constraint=constraint, event_dim=event_dim, name=name
      )
      assert value is not None  # type narrowing guaranteed by _param
      return value
  
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 3 for calling a global function with example usage: param(name, init_tensor, constraint, event_dim) and returns: value