966436403e5e927e3e7d5b389dad6ef06aaa7e03,fairseq/sequence_generator.py,EnsembleModel,__init__,#EnsembleModel#Any#,638
Before Change
self.incremental_states = torch.jit.annotate(
List[Dict[str, Dict[str, Optional[Tensor]]]],
[
torch.jit.annotate(Dict[str, Dict[str, Optional[Tensor]]], {})
for i in range(self.models_size)
],
)
self.has_incremental: bool = False
After Change
self.models = torch.nn.ModuleList(models)
self.incremental_states = None
if all(hasattr(m, "decoder") and isinstance(m.decoder, FairseqIncrementalDecoder) for m in models):
self.incremental_states = {m: {} for m in models}
def has_encoder(self):
return hasattr(self.models[0], "encoder")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: pytorch/fairseq
Commit Name: 966436403e5e927e3e7d5b389dad6ef06aaa7e03
Time: 2020-04-07
Author: akyrola@fb.com
File Name: fairseq/sequence_generator.py
Class Name: EnsembleModel
Method Name: __init__
Project Name: okfn-brasil/serenata-de-amor
Commit Name: a460674c772c2c0685148c8eb94b1743afea71d5
Time: 2017-09-28
Author: cuducos@users.noreply.github.com
File Name: jarbas/dashboard/admin.py
Class Name: ReimbursementModelAdmin
Method Name: get_search_results
Project Name: AlexsLemonade/refinebio
Commit Name: 8bc46bda10949ec121c784fa0dd70deea12438f9
Time: 2019-08-22
Author: arielsvn@gmail.com
File Name: foreman/data_refinery_foreman/foreman/management/commands/rerun_salmon_old_samples.py
Class Name:
Method Name: update_salmon_versions