code: def init_to_generated(site=None, generate=lambda: init_to_uniform):
      """
      Initialize to another initialization strategy returned by the callback
      ``generate`` which is called once per model execution.
  
      This is like :func:`init_to_value` but can produce different (e.g. random)
      values once per model execution. For example to generate values and return
      ``init_to_value`` you could define::
  
          def generate():
              values = {"x": torch.randn(100), "y": torch.rand(5)}
              return init_to_value(values=values)
  
          my_init_fn = init_to_generated(generate=generate)
  
      :param callable generate: A callable returning another initialization
          function, e.g. returning an ``init_to_value(values={...})`` populated
          with a dictionary of random samples.
      """
      init = _InitToGenerated(generate)
      return init if site is None else init(site)
  
imports: import functools
  from typing import Callable, Optional
  import torch
  from torch.distributions import transform_to
  from pyro.distributions.torch import Independent
  from pyro.distributions.torch_distribution import MaskedDistribution
  from pyro.infer.util import is_validation_enabled
  from pyro.poutine.messenger import Messenger
  from pyro.util import torch_isnan
  from .utils import helpful_support_errors
label_desc: Use image node_id 8 for calling a global function with example usage: init_to_generated(site, generate) and returns: unknown