code: def test_provenance_tensor(dtype1, dtype2):
      device = torch.device("cuda")
      x = torch.tensor([1, 2, 3], dtype=dtype1)
      y = ProvenanceTensor(x, frozenset(["x"]))
      z = torch.as_tensor(y, device=device, dtype=dtype2)
  
      assert x.shape == y.shape == z.shape
      assert_equal(x, z.cpu())
  
imports: import pytest
  import torch
  from pyro.ops.provenance import ProvenanceTensor, get_provenance, track_provenance
  from tests.common import assert_equal, requires_cuda
label_desc: Use image node_id 1 for calling a global function with example usage: test_provenance_tensor(dtype1, dtype2) without return types