(self, state_dict)
return state_dict_cpu
Copy a model state_dict to cpu.

        Args:
            state_dict (OrderedDict): Model weights on GPU.

        Returns:
            OrderedDict: Model weights on GPU.
Copy a model state_dict to cpu.
Copy a model state_dict to cpu .
def weights_to_cpu(self, state_dict):
        """Copy a model state_dict to cpu.

        Args:
            state_dict (OrderedDict): Model weights on GPU.

        Returns:
            OrderedDict: Model weights on GPU.
        """
        state_dict_cpu = OrderedDict()
        for key, val in state_dict.items():
            state_dict_cpu[key] = val.cpu()
        return state_dict_cpu
def weights_to_cpu ( self , state_dict ) : state_dict_cpu = OrderedDict ( ) for key , val in state_dict . items ( ) : state_dict_cpu [ key ] = val . cpu ( ) return state_dict_cpu