code: def test_posterior_predictive_svi_manual_guide(parallel):
      true_probs = torch.ones(5) * 0.7
      num_trials = torch.ones(5) * 1000
      num_success = dist.Binomial(num_trials, true_probs).sample()
      conditioned_model = poutine.condition(
          model, data={"obs": num_success}
      )
      elbo = Trace_ELBO(num_particles=100, vectorize_particles=True)
      svi = SVI(
          conditioned_model, beta_guide, optim.Adam(dict(lr=1.0)), elbo
      )
      for i in range(1000):
          svi.step(num_trials)
      posterior_predictive = Predictive(
          model,
          guide=beta_guide,
          num_samples=10000,
          parallel=parallel,
          return_sites=["_RETURN"],
      )
      marginal_return_vals = posterior_predictive(num_trials)["_RETURN"]
      assert_close(
          marginal_return_vals.mean(dim=0),
          torch.ones(5) * 700,
          rtol=0.05,
      )
  
file_path: pyro/tests/infer/test_predictive.py
imports: import pytest
  import torch
  import pyro
  import pyro.distributions
  import pyro.optim
  import pyro.poutine
  from pyro.infer import SVI, Predictive, Trace_ELBO
  from pyro.infer.autoguide import AutoDelta, AutoDiagonalNormal
  from tests.common import assert_close
label_desc: Use image node_id 4 for calling a global function with example usage: test_posterior_predictive_svi_manual_guide(parallel) without return types