02c0ef855321a2c9e681927b9cdaf0996c310893,tests/test_models.py,,test_get_backbone,#Any#Any#,16

Before Change


        model_cls, cfg, tokenizer, local_params_path, _ = get_backbone(name, root=root)
        if name == "gpt2_1558M":
            // skip gpt2 1558M due to the space
            return
        net = model_cls.from_cfg(cfg)
        net.load_parameters(local_params_path)
        net.hybridize()
        num_params, num_fixed_params = count_parameters(net.collect_params())

After Change


            out = net(inputs, valid_length, inputs, valid_length)
        elif "gpt2" in name:
            states = net.init_states(batch_size=batch_size, ctx=ctx)
            out, new_states = net(inputs, states)
            out_np = out.asnumpy()
        else:
            out = net(inputs, token_types, valid_length)
        mx.npx.waitall()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: dmlc/gluon-nlp
Commit Name: 02c0ef855321a2c9e681927b9cdaf0996c310893
Time: 2020-10-14
Author: xshiab@connect.ust.hk
File Name: tests/test_models.py
Class Name:
Method Name: test_get_backbone


Project Name: d2l-ai/d2l-zh
Commit Name: 3a770cbc97085c2cd4eaa0a46b2bc037f35389c2
Time: 2017-10-25
Author: muli@cs.cmu.edu
File Name: utils.py
Class Name:
Method Name: evaluate_accuracy


Project Name: dmlc/gluon-nlp
Commit Name: e137b24f4e7350342d0e7a2686e166bf378a405b
Time: 2020-09-02
Author: xshiab@connect.ust.hk
File Name: tests/test_models.py
Class Name:
Method Name: test_get_backbone