def METHOD_NAME(self):
    mesh = DeviceMesh(self.device_type, torch.arange(self.world_size))
    # create DTensor inside fn and run some compute
    def fn(x):
        dt = DTensor.from_local(x, mesh, [Replicate()], run_check=False)
        return dt.to_local() + 2
    # below is the op approach for reference
    # from torch.distributed._tensor.api import _FromTorchTensor
    # def from_local_tensor(x):
    #     return _FromTorchTensor.apply(x, mesh, [Replicate()], False)
    # _dt_lib_def = torch.library.Library("dtensor", "DEF")
    # _dt_lib_def.define("from_local(Tensor self) -> Tensor")
    # _dt_lib_impl = torch.library.Library("dtensor", "IMPL")
    # _dt_lib_impl.impl("from_local", from_local_tensor, "Autograd")
    x = torch.ones(1)
    ref = fn(x)
    opt_fn = torch.compile(fn, backend="eager", fullgraph=True)
    res = opt_fn(x)
    self.assertEqual(res, ref)
    # test if user calls from_local with mesh/placements as kwargs and that should still work
    def from_local_kwargs_fn(x):
        dt = DTensor.from_local(
            x, device_mesh=mesh, placements=[Replicate()], run_check=False
        )
        return dt.to_local() + 2
    ref = from_local_kwargs_fn(x)
    opt_kwargs_fn = torch.compile(
        from_local_kwargs_fn, backend="eager", fullgraph=True
    )
    res = opt_kwargs_fn(x)
    self.assertEqual(res, ref)