555ca942df407b8c1bf1d48383c60fa1bf09cc1d,keras/utils/layer_utils.py,,count_params,#Any#,12
Before Change
// Returns
The total number of scalars composing the weights
return int(np.sum([K.count_params(p) for p in set(weights)]))
def print_summary(model, line_length=None, positions=None, print_fn=None):
After Change
weight_ids = set()
total = 0
for w in weights:
if id(w) not in weight_ids:
weight_ids.add(id(w))
total += int(K.count_params(w))
return total
def print_summary(model, line_length=None, positions=None, print_fn=None):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: keras-team/keras
Commit Name: 555ca942df407b8c1bf1d48383c60fa1bf09cc1d
Time: 2019-08-28
Author: francois.chollet@gmail.com
File Name: keras/utils/layer_utils.py
Class Name:
Method Name: count_params
Project Name: keras-team/keras
Commit Name: 555ca942df407b8c1bf1d48383c60fa1bf09cc1d
Time: 2019-08-28
Author: francois.chollet@gmail.com
File Name: keras/engine/network.py
Class Name: Network
Method Name: losses
Project Name: pytorch/pytorch
Commit Name: 249c21346208b682d128e28fe4480262f8b76cd8
Time: 2021-02-27
Author: benjamin.lefaudeux@gmail.com
File Name: torch/distributed/optim/zero_redundancy_optimizer.py
Class Name: ZeroRedundancyOptimizer
Method Name: state_dict