code: def test_gsm_log_prob():
      sigmas = torch.tensor([2.0, 2.0])
      component_scale = torch.tensor([1.5, 2.5])
      logits = torch.tensor([math.log(0.25), math.log(0.75)])
      dist = GaussianScaleMixture(sigmas, logits, component_scale)
      value = torch.tensor([math.sqrt(0.33), math.sqrt(0.67)])
      log_prob = dist.log_prob(value).item()
      correct_log_prob = 0.25 * math.exp(-0.50 / (4.0 * 2.25)) / 2.25
      correct_log_prob += 0.75 * math.exp(-0.50 / (4.0 * 6.25)) / 6.25
      correct_log_prob /= (2.0 * math.pi) * 4.0
      correct_log_prob = math.log(correct_log_prob)
      assert_equal(
          log_prob,
          correct_log_prob,
          msg="bad log prob for GaussianScaleMixture",
      )
  
file_path: pyro/tests/distributions/test_gaussian_mixtures.py
imports: import logging
  import math
  import pytest
  import torch
  from pyro.distributions import GaussianScaleMixture, MixtureOfDiagNormals, MixtureOfDiagNormalsSharedCovariance
  from tests.common import assert_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_gsm_log_prob() without return types