code: def test_tensor_funsor_tensor(batch_shape, event_shape, event_output):
      event_inputs = ("foo", "bar", "baz")[
          : len(event_shape) - event_output
      ]
      t = torch.randn(batch_shape + event_shape)
      f = tensor_to_funsor(t, event_inputs, event_output)
      t2 = funsor_to_tensor(f, t.dim(), event_inputs)
      assert_close(t2, t)
  
imports: from collections import OrderedDict
  import pyro.distributions
  import pytest
  import torch
  from pyro.distributions.torch_distribution import MaskedDistribution
  from funsor.domains import Bint, Reals
  from funsor.pyro.convert import dist_to_funsor, funsor_to_cat_and_mvn, funsor_to_mvn, funsor_to_tensor, matrix_and_mvn_to_funsor, mvn_to_funsor, tensor_to_funsor
  from funsor.tensor import Tensor
  from funsor.terms import Funsor
  from funsor.testing import assert_close, random_mvn
label_desc: Use image node_id 1 for calling a global function with example usage: test_tensor_funsor_tensor(batch_shape, event_shape, event_output) without return types