def METHOD_NAME(self):
    spec = ChunkShardingSpec(
        dim=0,
        placements=[
            "rank:0/cuda:0",
            "rank:1/cuda:1",
            "rank:2/cuda:2",
            "rank:3/cuda:3",
        ],
    )
    st = sharded_tensor.rand(spec, (12, 5), requires_grad=True)
    local_shards = st.local_shards()
    # before set requires_grad, all local shards should not require grads
    for local_shard in local_shards:
        self.assertTrue(local_shard.tensor.requires_grad)
    detached_st = st.detach()
    self.assertFalse(detached_st.requires_grad)
    for local_shard in detached_st.local_shards():
        self.assertFalse(local_shard.tensor.requires_grad)