def _post_init(self):
    if self._init_rrefs:
        with _sharded_tensor_lock:
            global _sharded_tensor_current_id, _sharded_tensor_map
            self._sharded_tensor_id = _sharded_tensor_current_id
            _sharded_tensor_map[self._sharded_tensor_id] = weakref.ref(self)
            _sharded_tensor_current_id += 1
        if (not rpc._is_current_rpc_agent_set()):
            raise RuntimeError('RPC Framework needs to be initialized using torch.distributed.rpc.init_rpc if init_rrefs is set to True')
        self._init_rpc()
def _post_init(self):
    if self._init_rrefs:
        with _sharded_tensor_lock:
            global _sharded_tensor_current_id, _sharded_tensor_map
            self._sharded_tensor_id = _sharded_tensor_current_id
            _sharded_tensor_map[self._sharded_tensor_id] = weakref.ref(self)
            _sharded_tensor_current_id += 1
        if (not rpc._is_current_rpc_agent_set()):
            raise RuntimeError('RPC Framework needs to be initialized using torch.distributed.rpc.init_rpc if init_rrefs is set to True')
        self._init_rpc()