def save_params(model, fn):
    if fn in 'npz':
        param_vals = model if isinstance(model, list) else nn.layers.get_all_param_values(model)
        np.savez(fn, *param_vals)
    else:
        with open(fn, 'w') as wr:
            import pickle
            pickle.dump(param_vals, wr)

# reset shared variable values of accumulators to recover from NaN
dataset/ETHPy150Open woshialex/diagnose-heart/CNN_A/utils.py/save_params/swapped operands of `in`