def METHOD_NAME():
    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()