f122269dc50b76a4656d2542709ffe4837144a24,onmt/utils/loss.py,,shards,#Any#Any#Any#,246

Before Change


            yield dict(zip(keys, shard_tensors))

        // Assumed backprop"d
        variables = []
        for k, (v, v_split) in non_none.items():
            if isinstance(v, torch.Tensor) and state[k].requires_grad:
                variables.extend(zip(torch.split(state[k], shard_size),
                                     [v_chunk.grad for v_chunk in v_split]))
        inputs, grads = zip(*variables)
        torch.autograd.backward(inputs, grads)

After Change


        // want a sequence of dictionaries of tensors.
        // First, unzip the dictionary into a sequence of keys and a
        // sequence of tensor-like sequences.
        keys, values = zip(*((k, torch.split(v, shard_size))
                             for k, v in non_none.items()))

        // Now, yield a dictionary for each shard. The keys are always
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: f122269dc50b76a4656d2542709ffe4837144a24
Time: 2018-06-12
Author: vince62s@yahoo.com
File Name: onmt/utils/loss.py
Class Name:
Method Name: shards


Project Name: nilearn/nilearn
Commit Name: 9df22084c5753cd5b3480afddee054dcdd774438
Time: 2017-05-29
Author: dkamalakarreddy@gmail.com
File Name: nilearn/datasets/atlas.py
Class Name:
Method Name: fetch_atlas_harvard_oxford


Project Name: dmlc/gluon-nlp
Commit Name: 8880acf0899efee237251cbd01c7ff81fc535789
Time: 2018-06-22
Author: szhengac@users.noreply.github.com
File Name: scripts/nmt/bleu.py
Class Name:
Method Name: _split_compound_word