code: def test_unweighted_mean_and_var(size, dtype):
      samples = []
      for i in range(5):
          samples.append(torch.ones(size, dtype=dtype) * i)
      samples = torch.stack(samples)
      empirical_dist = Empirical(samples, torch.ones(5, dtype=dtype))
      true_mean = torch.ones(size) * 2
      true_var = torch.ones(size) * 2
      assert_equal(empirical_dist.mean, true_mean)
      assert_equal(empirical_dist.variance, true_var)
  
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 1 for calling a global function with example usage: test_unweighted_mean_and_var(size, dtype) without return types