3218a3987ef9f83d1ad5efd6f96d6f6c741c3cfa,python/eight_mile/pytorch/layers.py,,viterbi,#Any#Any#Any#Any#Any#Any#,776

Before Change


    rev_len = seq_len - lengths - 1
    for i, backpointer_t in enumerate(reversed(backpointers)):
        // Get new best tag candidate
        new_best_tag_id = backpointer_t[batch_range, best_tag_id]
        // We are going backwards now, if you passed your flipped length then you aren"t in your real results yet
        mask = (i > rev_len)
        best_tag_id = best_tag_id.masked_fill(mask, 0) + new_best_tag_id.masked_fill(mask == 0, 0)
        best_path.append(best_tag_id)

After Change


    best_path = [best_tag_id]
    for i, backpointer_t in enumerate(reversed(backpointers)):
        // Get new best tag candidate
        new_best_tag_id = backpointer_t.gather(1, best_tag_id.unsqueeze(1)).squeeze(1)
        // We are going backwards now, if flipped length was passed
        // these you aren"t in your real results yet
        mask = (i > rev_len)
        best_tag_id = best_tag_id.masked_fill(mask, 0) + new_best_tag_id.masked_fill(mask == 0, 0)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: dpressel/mead-baseline
Commit Name: 3218a3987ef9f83d1ad5efd6f96d6f6c741c3cfa
Time: 2019-09-27
Author: dpressel@gmail.com
File Name: python/eight_mile/pytorch/layers.py
Class Name:
Method Name: viterbi


Project Name: SPFlow/SPFlow
Commit Name: 3297b14525656040f3a456b2c23c7ffb7e6b7cfc
Time: 2020-03-22
Author: steven.lang.mz@gmail.com
File Name: src/spn/algorithms/layerwise/distributions.py
Class Name:
Method Name: dist_sample


Project Name: dpressel/mead-baseline
Commit Name: 8516950fa0683319a31f91e80148ddd62ff56a49
Time: 2019-01-10
Author: blester125@users.noreply.github.com
File Name: python/baseline/pytorch/crf.py
Class Name:
Method Name: viterbi