(self, _dict)
return _dict
if local, skip torch <--> numpy
if local, skip torch <--> numpy
if local skip torch < -- > numpy
def state_dict_to_numpy(self, _dict):
        """ if local, skip torch <--> numpy """
        if self.runs_distributed:
            np_dict = {}
            for k in list(_dict.keys()):
                if isinstance(_dict[k], np.ndarray):
                    np_dict[k] = _dict[k]
                else:
                    np_dict[k] = _dict[k].cpu().numpy()

            return np_dict

        return _dict
def state_dict_to_numpy ( self , _dict ) : if self . runs_distributed : np_dict = { } for k in list ( _dict . keys ( ) ) : if isinstance ( _dict [ k ] , np . ndarray ) : np_dict [ k ] = _dict [ k ] else : np_dict [ k ] = _dict [ k ] . cpu ( ) . numpy ( ) return np_dict return _dict