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

Before Change


        out = model(input_ids.as_in_context(ctx),
                    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())

After Change


    logging.info("Time cost=%.2fs, throughput=%.2f samples/s", toc - tic,
                 dev_batch_size * len(loader_test) / (toc - tic))
    // write result to a file.
    filename = args.task_name + segment.replace("test", "") + ".csv"
    test_path = os.path.join(args.output_dir, filename)
    with io.open(test_path, "w", encoding="utf-8") as f:
        f.write(u"index\tprediction\n")
        for i, pred in enumerate(results):
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: evilsocket/pwnagotchi
Commit Name: 2f948306ebeabf10050bb0c07a3254b420c30751
Time: 2019-11-01
Author: evilsocket@gmail.com
File Name: pwnagotchi/plugins/__init__.py
Class Name:
Method Name: load_from_path


Project Name: catalyst-team/catalyst
Commit Name: 1ef3ad90a3423ed15ca41e0ea4e81012ebe84a9f
Time: 2020-08-11
Author: scitator@gmail.com
File Name: catalyst/data/scripts/project_embeddings.py
Class Name:
Method Name: main