(self, _dict, device)
return new_dict
if local, skip torch <--> numpy
if local, skip torch <--> numpy
if local skip torch < -- > numpy
def state_dict_to_torch(self, _dict, device):
        """ if local, skip torch <--> numpy """

        new_dict = {}
        if self.runs_distributed:
            for k in list(_dict.keys()):
                if isinstance(_dict[k], np.ndarray):
                    new_dict[k] = torch.from_numpy(_dict[k])
                else:
                    new_dict[k] = _dict[k]

                new_dict[k] = new_dict[k].to(device)
        else:
            for k in list(_dict.keys()):
                new_dict[k] = _dict[k].to(device)

        return new_dict
def state_dict_to_torch ( self , _dict , device ) : new_dict = { } if self . runs_distributed : for k in list ( _dict . keys ( ) ) : if isinstance ( _dict [ k ] , np . ndarray ) : new_dict [ k ] = torch . from_numpy ( _dict [ k ] ) else : new_dict [ k ] = _dict [ k ] new_dict [ k ] = new_dict [ k ] . to ( device ) else : for k in list ( _dict . keys ( ) ) : new_dict [ k ] = _dict [ k ] . to ( device ) return new_dict