6126960c57919dc71237609c76c2d0449834c24c,examples/model_compress/amc/amc_train.py,,get_model,#Any#,48

Before Change


        raise NotImplementedError

    if args.model_type == "mobilenet":
        net = MobileNet(n_class=n_class).cuda()
    elif args.model_type == "mobilenetv2":
        net = MobileNetV2(n_class=n_class).cuda()
    else:
        raise NotImplementedError

After Change


        net.load_state_dict(torch.load(args.ckpt_path))
        if args.mask_path is not None:
            SZ = 224 if args.dataset == "imagenet" else 32
            data = torch.randn(2, 3, SZ, SZ)
            ms = ModelSpeedup(net, data, args.mask_path)
            ms.speedup_model()

    net.to(args.device)
    if torch.cuda.is_available() and args.n_gpu > 1:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: Microsoft/nni
Commit Name: 6126960c57919dc71237609c76c2d0449834c24c
Time: 2020-10-10
Author: 38930155+chicm-ms@users.noreply.github.com
File Name: examples/model_compress/amc/amc_train.py
Class Name:
Method Name: get_model


Project Name: pytorch/tutorials
Commit Name: 0ad33d606682537466f3430fc6d6ac7d47460f1a
Time: 2018-04-24
Author: soumith@gmail.com
File Name: beginner_source/blitz/tensor_tutorial.py
Class Name:
Method Name:


Project Name: kymatio/kymatio
Commit Name: 4f91cb1bfab978c05a30de8a70e36426aaa19df5
Time: 2018-11-21
Author: janden@flatironinstitute.org
File Name: examples/3d/compute_speed.py
Class Name:
Method Name: