code: def test_deep_to_beta(shape, dtype):
      concentration1 = torch.tensor(0.5, requires_grad=True)
      concentration0 = torch.tensor(2.0, requires_grad=False)
      d1 = dist.Beta(concentration1, concentration0)
      if shape is not None:
          d1 = d1.expand(shape)
  
      d2 = deep_to(d1, dtype)
      d2.log_prob(d2.sample().detach())  # smoke test
      assert type(d1) is type(d2)
      assert d2.batch_shape == d1.batch_shape
      assert_equal(d1.concentration1.to(dtype), d2.concentration1)
      assert_equal(d1.concentration0.to(dtype), d2.concentration0)
      assert (
          d2.concentration1.requires_grad
          == d1.concentration1.requires_grad
      )
      assert (
          d2.concentration0.requires_grad
          == d1.concentration0.requires_grad
      )
  
imports: import weakref
  import numpy
  import pytest
  import torch
  from torch.autograd import grad
  import pyro.distributions
  from pyro.distributions import constraints
  from pyro.distributions.util import broadcast_shape, deep_to, detach, sum_leftmost, sum_rightmost, weakmethod
  from pyro.nn.module import PyroModule, PyroParam, PyroSample
  from tests.common import assert_equal
label_desc: Use image node_id 13 for calling a global function with example usage: test_deep_to_beta(shape, dtype) without return types