'Save parameters to file.
filename : str
Path to parameter file.
strip_prefix : str, default \'\'
Strip prefix from parameter names before saving.'

def save(self, filename, strip_prefix=''):

    arg_dict = {}
    for param in self.values():
        weight = param._reduce()
        if (not param.name.startswith(strip_prefix)):
            raise ValueError(('Prefix    %s    is    to    be    striped    before    saving,    but    Parameter    %s    does    not    start    with    %s.    If    you    are    using    Block.save_params,    This    may    be    due    to    your    Block    shares    parameters    from    other    Blocks    or    you    forgot    to    use    `with    name_scope()``    during    init.    Consider    switching    to    Block.collect_params.save    and    Block.collect_params.load    instead.' % (strip_prefix, param.name, strip_prefix)))
        arg_dict[param.name[len(strip_prefix):]] = weight
    ndarray.save(filename, arg_dict)
