requires_grad = getattr(self, "requires_grad", None)
if isinstance(value, DTensorBase):
local_value = value.to_local()
if hasattr(value, "device_mesh"):
self._device_mesh = value.device_mesh
if hasattr(value, "placements"):
self._placements = value.placements
if hasattr(value, "layout"):
self._layout = value.layout
else:
local_value = value
data_descriptor = _tensor_data_descriptor()
with getattr(torch, "_C").DisableTorchFunctionSubclass():