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: 5

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: dPys/PyNets
Commit Name: 32234b97cd894b0849f5d151601ea4051cd1b123
Time: 2019-10-12
Author: dpisner@utexas.edu
File Name: pynets/core/utils.py
Class Name:
Method Name: collect_pandas_df_make


Project Name: dgasmith/opt_einsum
Commit Name: cea9099ef36997bc0922e3fdf8c4be88c9910d9a
Time: 2018-07-21
Author: john.gray.14@ucl.ac.uk
File Name: opt_einsum/contract.py
Class Name:
Method Name: format_const_einsum_str