1082ba352c5f1d524b1fcba43ee611280b169224,fairseq/trainer.py,Trainer,valid_step,#Trainer#Any#,310
Before Change
logging_outputs = [logging_output]
// aggregate stats and logging outputs
ntokens = sum(log.get("ntokens", 0) for log in logging_outputs)
grad_denom = self.criterion.__class__.grad_denom(sample_sizes)
agg_logging_output = self.criterion.__class__.aggregate_logging_outputs(logging_outputs)
After Change
self.model.eval()
logging_output, sample_size = {}, 0
with torch.no_grad():
sample = self._prepare_sample(sample)
if sample is None:
sample = self._prepare_sample(self._dummy_batch)
_loss, sample_size, logging_output = self.task.get_loss(
self.model, self.criterion, sample,
)
// gather logging outputs from all replicas
if self.args.distributed_world_size > 1:
logging_output, sample_size = zip(*distributed_utils.all_gather_list(
[logging_output, sample_size],
))
In pattern: SUPERPATTERN
Frequency: 6
Non-data size: 6
Instances
Project Name: elbayadm/attn2d
Commit Name: 1082ba352c5f1d524b1fcba43ee611280b169224
Time: 2018-09-25
Author: edunov@apache.org
File Name: fairseq/trainer.py
Class Name: Trainer
Method Name: valid_step
Project Name: SpiNNakerManchester/sPyNNaker
Commit Name: 73162ce7ca689cd10f67b823f54d3fbf81e8ee91
Time: 2021-02-25
Author: donal.k.fellows@manchester.ac.uk
File Name: doc/source/conf.py
Class Name:
Method Name: filtered_files
Project Name: pantsbuild/pants
Commit Name: f619b466cb6ff5407000a9eb7e162c9a75aad167
Time: 2015-08-28
Author: stuhood@gmail.com
File Name: src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile_isolated_strategy.py
Class Name: JvmCompileIsolatedStrategy
Method Name: compute_classes_by_source
Project Name: ClementPinard/SfmLearner-Pytorch
Commit Name: 2a74e12fec206dd222f98cd3ac2a15c48ebdf0a9
Time: 2019-02-18
Author: clement.pinard@parrot.com
File Name: data/prepare_train_data.py
Class Name:
Method Name: main
Project Name: reinforceio/tensorforce
Commit Name: 4691abc3017a4c3bc71dd5d056da42b28b51dcb2
Time: 2018-08-31
Author: alexkuhnle@t-online.de
File Name: tensorforce/models/model.py
Class Name: Model
Method Name: setup