9d22742baeeb608bac5594c3ece96f62f0734dce,qanta/buzzer/trainer.py,Trainer,test,#Trainer#Any#,62

Before Change


            for i, (qnum, action) in enumerate(zip(batch.qids, actions)):
                if isinstance(qnum, np.ndarray):
                    qnum = qnum.tolist()
                finals[qnum] = np.argmax(ys[i][-1][:N_GUESSERS]).tolist()
                buzzes[qnum] = [-1, -1]
                for pos, chosen in enumerate(action):
                    if chosen < N_GUESSERS:
                        buzzes[qnum] = (pos, chosen)

After Change


                if isinstance(qnum, np.ndarray):
                    qnum = qnum.tolist()
                total = int(sum(mask))
                buzzes[qnum] = scores[:total].tolist()
            progress_bar(*test_iter.epoch_detail)
        test_iter.finalize(reset=True)
        progress_bar.finalize()
        return buzzes
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: Pinafore/qb
Commit Name: 9d22742baeeb608bac5594c3ece96f62f0734dce
Time: 2017-05-13
Author: sjtufs@gmail.com
File Name: qanta/buzzer/trainer.py
Class Name: Trainer
Method Name: test


Project Name: stanfordnlp/stanza
Commit Name: de634a0c0df0ff33c20f52d5ebb42b90ad8a82bf
Time: 2020-05-21
Author: horatio@gmail.com
File Name: stanza/models/classifiers/cnn_classifier.py
Class Name:
Method Name: label_text


Project Name: Pinafore/qb
Commit Name: 884c2608fd72f2a6e9b304c412ab4edbe86a55b1
Time: 2017-05-11
Author: sjtufs@gmail.com
File Name: qanta/buzzer/trainer.py
Class Name: Trainer
Method Name: test