555ca942df407b8c1bf1d48383c60fa1bf09cc1d,keras/engine/network.py,Network,losses,#Network#,417
Before Change
// Add any potential unconditional model-level loss.
losses += self.get_losses_for(None)
unique_tensors = list(
set(x for x in losses if not isinstance(x, (float, int))))
non_tensors = [x for x in losses if isinstance(x, (float, int))]
return unique_tensors + non_tensors
@property
After Change
losses += self.get_losses_for(None)
unique_tensors = []
unique_tensors_ids = set()
for x in losses:
if not isinstance(x, (float, int)):
if id(x) not in unique_tensors_ids:
unique_tensors.append(x)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances 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: ray-project/ray
Commit Name: 30c22921d95bb66b6400c52fb19d640cbd0ee3e9
Time: 2020-12-28
Author: simon.mo@hey.com
File Name: python/ray/serve/controller.py
Class Name: ActorStateReconciler
Method Name: _check_currently_stopping_replicas
Project Name: ray-project/ray
Commit Name: 30c22921d95bb66b6400c52fb19d640cbd0ee3e9
Time: 2020-12-28
Author: simon.mo@hey.com
File Name: python/ray/serve/controller.py
Class Name: ActorStateReconciler
Method Name: _check_currently_starting_replicas