<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_params( self, f=None, f_params=None, f_optimizer=None, f_history=None, checkpoint=None):
 """Loads the the module's parameters, history, and optimizer, not the whole object. To save and load the whole object, use pickle. ``f_params`` and ``f_optimizer`` uses PyTorchs' :func:`~torch.save`. Parameters f_params : file-like object, str, None (default=None) Path of module parameters. Pass ``None`` to not load. f_optimizer : file-like object, str, None (default=None) Path of optimizer. Pass ``None`` to not load. f_history : file-like object, str, None (default=None) Path to history. Pass ``None`` to not load. checkpoint : :class:`.Checkpoint`, None (default=None) Checkpoint to load params from. If a checkpoint and a ``f_*`` path is passed in, the ``f_*`` will be loaded. Pass ``None`` to not load. f : deprecated Examples -------- """

        def _get_state_dict(f):
            map_location = get_map_location(self.device)
            self.device = self._check_device(self.device, map_location)
            return torch.load(f, map_location=map_location)

        # TODO: Remove warning in a future release
        if f is not None:
            warnings.warn(
                "f is deprecated in save_params and will be removed in the "
                "next release, please use f_params instead",
                DeprecationWarning)
            f_params = f

        if f_history is not None:
            self.history = History.from_file(f_history)

        if checkpoint is not None:
            if f_history is None and checkpoint.f_history is not None:
                self.history = History.from_file(checkpoint.f_history_)
            formatted_files = checkpoint.get_formatted_files(self)
            f_params = f_params or formatted_files['f_params']
            f_optimizer = f_optimizer or formatted_files['f_optimizer']

        if f_params is not None:
            if not hasattr(self, 'module_'):
                raise NotInitializedError(
                    "Cannot load parameters of an un-initialized model. "
                    "Please initialize first by calling .initialize() "
                    "or by fitting the model with .fit(...).")
            state_dict = _get_state_dict(f_params)
            self.module_.load_state_dict(state_dict)

        if f_optimizer is not None:
            if not hasattr(self, 'optimizer_'):
                raise NotInitializedError(
                    "Cannot load state of an un-initialized optimizer. "
                    "Please initialize first by calling .initialize() "
                    "or by fitting the model with .fit(...).")
            state_dict = _get_state_dict(f_optimizer)
            self.optimizer_.load_state_dict(state_dict)