def change_device(arg_params, aux_params, ctx):
    """Changes device of given mxnet arguments

    Args:
        arg_params (dict): arguments
        aux_params (dict): auxiliary parameters
        ctx (mx.cpu or mx.gpu): new device context

    Returns:
        dicts: arguments and auxiliary parameters on new device
    """
    new_args = dict()
    new_auxs = dict()
    for k, v in arg_params.items():
        new_args[k] = v.as_in_context(ctx)
    for k, v in aux_params.items():
        new_auxs[k] = v.as_in_context(ctx)
    return new_args, new_auxs