def count_params(layer, **tags):
    params = get_all_params(layer, **tags)
    shapes = [p.get_value().shape for p in params]
    counts = [np.prod(shape) for shape in shapes]
    return sum(counts)
This function counts all parameters (i.e., the number of scalar
dataset/ETHPy150Open Lasagne/Lasagne/lasagne/layers/helper.py/count_params