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

Before Change


    logging.info("Now we are doing testing on %s with %s.", segment, ctx)

    tic = time.time()
    value_list = []
    index_list = []
    for _, seqs in enumerate(loader_test):
        input_ids, valid_length, type_ids = seqs
        out = model(input_ids.as_in_context(ctx),

After Change


                results.append("{:.3f}".format(result))
        else:
            // 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,
                 dev_batch_size * len(loader_test) / (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: IBM/adversarial-robustness-toolbox
Commit Name: 8acacf7ecdddd031366f2c044bdc6ce5ba8e5a62
Time: 2018-10-04
Author: Maria-Irina.Nicolae@ibm.com
File Name: art/classifiers/mxnet.py
Class Name: MXTextClassifier
Method Name: predict_from_embedding


Project Name: geek-ai/MAgent
Commit Name: d15a15df582f43d9bc65a434db0d64c9e276b724
Time: 2017-11-23
Author: zhenglianmin96@163.com
File Name: python/magent/builtin/mx_model/dqn.py
Class Name: DeepQNetwork
Method Name: infer_action