code: def test_diag_normal_log_prob_shape():
      loc1 = torch.zeros(2, 3)
      loc2 = torch.zeros(2, 4)
      scale = torch.ones(2, 1)
      d1 = dist.Normal(loc1, scale.expand_as(loc1)).to_event(1)
      d2 = dist.Normal(loc2, scale.expand_as(loc2)).to_event(1)
      x1 = d1.sample()
      x2 = d2.sample()
      assert d1.log_prob(x1).size() == (2,)
      assert d2.log_prob(x2).size() == (2,)
  
file_path: pyro/tests/distributions/test_shapes.py
imports: import torch
  import pyro.distributions
label_desc: Use image node_id 10 for calling a global function with example usage: test_diag_normal_log_prob_shape() without return types