<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save_params( self, f=None, f_params=None, f_optimizer=None, f_history=None):
 """Saves the module's parameters, history, and optimizer, not the whole object. To save 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 save f_optimizer : file-like object, str, None (default=None) Path of optimizer. Pass ``None`` to not save f_history : file-like object, str, None (default=None) Path to history. Pass ``None`` to not save f : deprecated Examples -------- """


        # TODO: Remove warning in a future release
        if f is not None:
            warnings.warn(
                "f argument was renamed to f_params and will be removed "
                "in the next release. To make your code future-proof it is "
                "recommended to explicitly specify keyword arguments' names "
                "instead of relying on positional order.",
                DeprecationWarning)
            f_params = f

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

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

        if f_history is not None:
            self.history.to_file(f_history)