def count_params(x):
    shape = x.get_shape()
    return np.prod([shape[i]._value for i in range(len(shape))])
Returns the number of scalars in a tensor.
dataset/ETHPy150Open fchollet/keras/keras/backend/tensorflow_backend.py/count_params