code: def test_fresh_inputs_to_funsor():
      def testing():
          x = pyro.to_funsor(
              torch.tensor([0.0, 1.0]),
              funsor.Real,
              dim_to_name={-1: "x"},
          )
          assert set(x.inputs) == {"x"}
          px = pyro.to_funsor(
              torch.ones(2, 3),
              funsor.Real,
              dim_to_name={-2: "x", -1: "y"},
          )
          assert px.inputs["x"].dtype == 2 and px.inputs["y"].dtype == 3
  
      with pyro_backend("contrib.funsor"), NamedMessenger():
          testing()
  
file_path: pyro/tests/contrib/funsor/test_named_handlers.py
imports: import logging
  from collections import OrderedDict
  import pytest
  import torch
label_desc: Use image node_id 4 for calling a global function with example usage: test_fresh_inputs_to_funsor() without return types