49ec0bd72b85be55579ae8ceb278c66145f593e1,mnist_hogwild/main.py,,,#,49

Before Change



    use_cuda = args.cuda and torch.cuda.is_available()
    device = torch.device("cuda" if use_cuda else "cpu")
    dataloader_kwargs = {"pin_memory": True} if use_cuda else {}

    torch.manual_seed(args.seed)
    mp.set_start_method("spawn")

After Change



    use_cuda = args.cuda and torch.cuda.is_available()
    device = torch.device("cuda" if use_cuda else "cpu")
    transform=transforms.Compose([
        transforms.ToTensor(),
        transforms.Normalize((0.1307,), (0.3081,))
        ])
    dataset1 = datasets.MNIST("../data", train=True, download=True,
                       transform=transform)
    dataset2 = datasets.MNIST("../data", train=False,
                       transform=transform)
    kwargs = {"batch_size": args.batch_size,
              "shuffle": True}
    if use_cuda:
        kwargs.update({"num_workers": 1,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pytorch/examples
Commit Name: 49ec0bd72b85be55579ae8ceb278c66145f593e1
Time: 2020-07-01
Author: matti.picus@gmail.com
File Name: mnist_hogwild/main.py
Class Name:
Method Name:


Project Name: eriklindernoren/PyTorch-YOLOv3
Commit Name: 8af5800b9a74cf7b2c8d2577b7d9be3ef987f26b
Time: 2021-04-09
Author: florian@flova.de
File Name: detect.py
Class Name:
Method Name: detect_image


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 61228f3243eaee39cba31a9abd2afc6ead9612a8
Time: 2018-05-04
Author: eriklindernoren@gmail.com
File Name: implementations/cyclegan/models.py
Class Name: UNetDown
Method Name: __init__