<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(arg_params: Mapping[str, mx.nd.NDArray], fname: str, aux_params: Optional[Mapping[str, mx.nd.NDArray]] = None):
 """ Saves the parameters to a file. :param arg_params: Mapping from parameter names to the actual parameters. :param fname: The file name to store the parameters in. :param aux_params: Optional mapping from parameter names to the auxiliary parameters. """

    save_dict = {('arg:%s' % k): v.as_in_context(mx.cpu()) for k, v in arg_params.items()}
    if aux_params is not None:
        save_dict.update({('aux:%s' % k): v.as_in_context(mx.cpu()) for k, v in aux_params.items()})
    mx.nd.save(fname, save_dict)