cfd2a3a048ca2d66d7c40d58f21179c8eb6c264c,fairseq/criterions/adaptive_loss.py,AdaptiveLoss,forward,#AdaptiveLoss#Any#Any#Any#,32

Before Change


        sample_size = sample["target"].size(0) if self.args.sentence_avg else sample["ntokens"]
        logging_output = {
            "loss": utils.item(loss.data) if reduce else loss.data,
            "ntokens": sample["ntokens"],
            "nsentences": sample["target"].size(0),
            "sample_size": sample_size,
        }

After Change


                                        reduce=reduce)

        orig = utils.strip_pad(orig_target, self.padding_idx)
        ntokens = orig.numel()
        sample_size = sample["target"].size(0) if self.args.sentence_avg else ntokens
        logging_output = {
            "loss": utils.item(loss.data) if reduce else loss.data,
            "ntokens": ntokens,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 7

Non-data size: 2

Instances


Project Name: elbayadm/attn2d
Commit Name: cfd2a3a048ca2d66d7c40d58f21179c8eb6c264c
Time: 2018-09-25
Author: alexei.b@gmail.com
File Name: fairseq/criterions/adaptive_loss.py
Class Name: AdaptiveLoss
Method Name: forward


Project Name: BindsNET/bindsnet
Commit Name: dcc5890dc2773090ab46a5e8bdd981a1104d9273
Time: 2018-06-29
Author: djsaunde@umass.edu
File Name: bindsnet/evaluation/__init__.py
Class Name:
Method Name: update_ngram_scores


Project Name: cornellius-gp/gpytorch
Commit Name: c4ba030fc0086a652cb99d607ce957276cf8c10e
Time: 2021-02-23
Author: wjm363@nyu.edu
File Name: gpytorch/models/exact_prediction_strategies.py
Class Name: DefaultPredictionStrategy
Method Name: __init__


Project Name: Microsoft/nni
Commit Name: d1c63562a92a550054fac9a809fe16970bf4acee
Time: 2020-09-21
Author: im.cqyan@gmail.com
File Name: src/sdk/pynni/nni/compression/torch/utils/counter.py
Class Name:
Method Name: count_linear_mask


Project Name: masa-su/pixyz
Commit Name: 669db4064682fd00363e50fa72572ea675789e85
Time: 2019-05-11
Author: masa@weblab.t.u-tokyo.ac.jp
File Name: pixyz/flows/operations.py
Class Name: Preprocess
Method Name: forward


Project Name: BindsNET/bindsnet
Commit Name: dcc5890dc2773090ab46a5e8bdd981a1104d9273
Time: 2018-06-29
Author: djsaunde@umass.edu
File Name: bindsnet/evaluation/__init__.py
Class Name:
Method Name: ngram