code: def test_mean_var_non_nan():
      true_mean = torch.randn([1, 2, 3])
      samples, weights = [], []
      for i in range(10):
          samples.append(true_mean)
          weights.append(torch.tensor(-1000.0))
      samples, weights = torch.stack(samples), torch.stack(weights)
      empirical_dist = Empirical(samples, weights)
      assert_equal(empirical_dist.mean, true_mean)
      assert_equal(empirical_dist.variance, torch.zeros_like(true_mean))
  
file_path: pyro/tests/distributions/test_empirical.py
imports: import pytest
  import torch
  from pyro.distributions.empirical import Empirical
  from tests.common import assert_close, assert_equal
label_desc: Use image node_id 7 for calling a global function with example usage: test_mean_var_non_nan() without return types