d63abb86304d5ceca8ec14109a4812258f9839ea,scripts/bert/finetune_classifier.py,,test,#Any#Any#,363

Before Change


        input_ids, valid_length, type_ids = seqs
        out = model(input_ids.as_in_context(ctx),
                    type_ids.as_in_context(ctx),
                    valid_length.astype("float32").as_in_context(ctx))
        if not task.class_labels:
            // regression task
            for result in out.asnumpy().reshape(-1).tolist():

After Change


    for _, seqs in enumerate(loader_test):
        input_ids, valid_length, segment_ids = seqs
        input_ids = input_ids.as_in_context(ctx)
        valid_length = valid_length.as_in_context(ctx).astype("float32")
        if use_roberta:
            out = model(input_ids, valid_length)
        else:
            out = model(input_ids, segment_ids.as_in_context(ctx), valid_length)
        if not task.class_labels:
            // regression task
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: dmlc/gluon-nlp
Commit Name: d63abb86304d5ceca8ec14109a4812258f9839ea
Time: 2019-09-24
Author: linhaibin.eric@gmail.com
File Name: scripts/bert/finetune_classifier.py
Class Name:
Method Name: test


Project Name: dmlc/dgl
Commit Name: 57b07fce920c11a0788cd1c97d529a51d006db3d
Time: 2018-12-02
Author: zhengda1936@gmail.com
File Name: examples/mxnet/sse/sse_batch.py
Class Name: DGLSSEUpdateHidden
Method Name: forward


Project Name: dmlc/gluon-nlp
Commit Name: d63abb86304d5ceca8ec14109a4812258f9839ea
Time: 2019-09-24
Author: linhaibin.eric@gmail.com
File Name: scripts/bert/finetune_classifier.py
Class Name:
Method Name: evaluate