5ea0c27f524a3e684d9a2e6f012e30e6da2de8aa,scripts/bert/finetune_classifier.py,,test,#Any#Any#,334

Before Change


                    type_ids.as_in_context(ctx),
                    valid_length.astype("float32").as_in_context(ctx))
        values, indices = mx.nd.topk(out, k=1, ret_typ="both")
        value_list.extend(values.asnumpy().reshape(-1).tolist())
        index_list.extend(indices.asnumpy().reshape(-1).tolist())

    mx.nd.waitall()

After Change


            // classification task
            indices = mx.nd.topk(out, k=1, ret_typ="indices", dtype="int32").asnumpy()
            for index in indices:
                results.append(task.class_labels[int(index)])

    mx.nd.waitall()
    toc = time.time()
    logging.info("Time cost=%.2fs, throughput=%.2f samples/s", toc - tic,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: dmlc/gluon-nlp
Commit Name: 5ea0c27f524a3e684d9a2e6f012e30e6da2de8aa
Time: 2019-06-18
Author: linhaibin.eric@gmail.com
File Name: scripts/bert/finetune_classifier.py
Class Name:
Method Name: test


Project Name: NifTK/NiftyNet
Commit Name: f360de0fa4454122d665b9c32f4d5911a4ebec0c
Time: 2017-08-19
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/loss.py
Class Name: LossFunction
Method Name: layer_op


Project Name: dmlc/gluon-nlp
Commit Name: 090944e816fd3ff8e861fba4452851e0a901491d
Time: 2019-01-28
Author: linhaibin.eric@gmail.com
File Name: scripts/language_model/large_word_language_model.py
Class Name:
Method Name: train