code: def test_ffb_intractable_2(backward):
      """
      def model(data):
          with pyro.plate("i", 2):
              a = pyro.sample("a", dist.Normal(0, 1))
          b = pyro.sample("b", dist.Normal(a.sum(), 1), obs=data)
      """
      num_samples = int(1e5)
  
      factors = {
          "a": random_gaussian(OrderedDict({"i": Bint[2], "a": Real})),
          "b": random_gaussian(OrderedDict({"a_i": Reals[2]})),
      }
      eliminate = frozenset(["a", "i"])
      plates = frozenset(["i"])
  
      if backward == "sample":
          sample_inputs = {"particle": Bint[num_samples]}
          rng_key = (
              None
              if get_backend() != "jax"
              else np.array([0, 0], dtype=np.uint32)
          )
          (
              actual_samples,
              actual_log_prob,
          ) = forward_filter_backward_rsample(
              factors, eliminate, plates, sample_inputs, rng_key
          )
      elif backward == "precondition":
          samples, log_prob = forward_filter_backward_precondition(
              factors, eliminate, plates
          )
          actual_samples, actual_log_prob = substitute_aux(
              samples, log_prob, num_samples
          )
  
      assert set(actual_samples) == {"a"}
      assert set(actual_samples["a"].inputs) == {"particle", "i"}
      check_ffbr(
          factors, eliminate, plates, actual_samples, actual_log_prob
      )
  
imports: from collections import OrderedDict
  from typing import Dict, Tuple
  import numpy
  import pytest
  import funsor.ops
  from funsor.domains import Bint, Real, Reals
  from funsor.interpretations import memoize
  from funsor.montecarlo import extract_samples
  from funsor.recipes import forward_filter_backward_precondition, forward_filter_backward_rsample
  from funsor.terms import Lambda, Variable
  from funsor.testing import Tensor, assert_close, randn, random_gaussian
  from funsor.util import get_backend
label_desc: Use image node_id 10 for calling a global function with example usage: test_ffb_intractable_2(backward) without return types