code: def test(self):
      with deepspeed.zero.Init():
          l = torch.nn.Linear(4, 2)
      assert l.weight.ds_status == ZeroParamStatus.NOT_AVAILABLE
  
      # Gather and make a change
      with deepspeed.zero.GatheredParameters(l.weight, modifier_rank=1):
          assert l.weight.ds_status == ZeroParamStatus.AVAILABLE
          if dist.get_rank() == 1:
              with torch.no_grad():
                  l.weight.zero_()
  
      # should now be scattered again
  
      # Now gather again and ensure the change is global
      with deepspeed.zero.GatheredParameters(l.weight):
          # all ranks compare
          assert torch.equal(l.weight, torch.zeros_like(l.weight))
  
imports: import os
  from types import SimpleNamespace
  import torch
  import pytest
  import deepspeed
  from deepspeed.runtime.zero.partition_parameters import ZeroParamStatus, partitioned_param_data_shape
  import deepspeed.comm
  from unit.common import DistributedTest, get_master_port
label_desc: Use image node_id 1 for calling the TestGatherUpdate obj's underlying member method code with example usage: obj.test() without return types