Optimization & Training https://github.com/pytorch/examples/tree/master/mnist Load Packages import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms import numpy as np no_cuda = False # cuda를 사용할지 안할지 use_cuda = not no_cuda and torch.cuda.is_available() device = torch.device("cuda" if use_cuda else "cpu") => devic.....
원문 링크 : [PyTorch] Optimizer 및 Training