docstr: Test that when a PosteriorList has two posteriors, result of
  `scalarize_posterior` matches quantitative expectations, analyitically
  computed by hand.
code: def test_scalarize_posterior_two_posteriors(self) -> None:
      """
      Test that when a PosteriorList has two posteriors, result of
      `scalarize_posterior` matches quantitative expectations, analyitically
      computed by hand.
      """
      m = 1
      for batch_shape, lazy, dtype in itertools.product(
          ([], [3]), (False, True), (torch.float, torch.double)
      ):
          tkwargs = {"device": self.device, "dtype": dtype}
  
          posterior = _get_test_posterior(
              batch_shape, m=m, lazy=lazy, **tkwargs
          )
          posterior_list = PosteriorList(posterior, posterior)
          scalarized_posterior = scalarize_posterior(
              posterior, weights=torch.ones(1, **tkwargs)
          )
  
          scalarized_posterior_list = scalarize_posterior(
              posterior_list, weights=torch.arange(1, 3, **tkwargs)
          )
          # 1 * orig mean + 2 * orig mean
          self.assertTrue(
              torch.allclose(
                  scalarized_posterior.mean * 3,
                  scalarized_posterior_list.mean,
              )
          )
          # 1 * orig var + 2^2 * orig var
          self.assertTrue(
              torch.allclose(
                  scalarized_posterior.variance * 5,
                  scalarized_posterior_list.variance,
              )
          )
  
file_path: botorch/test/posteriors/test_posteriorlist.py
imports: import itertools
  import torch
  from botorch.posteriors.gpytorch import scalarize_posterior
  from botorch.posteriors.posterior_list import PosteriorList
  from botorch.utils.testing import _get_test_posterior, BotorchTestCase
label_desc: Use image node_id 1 for calling the TestPosteriorList obj's underlying member method code with example usage: obj.test_scalarize_posterior_two_posteriors() without return types