This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax = tonistiigi/dockerfile:runmount20180618 | |
# | |
# `RUN --mount` example. Requires Docker v18.06 with `DOCKER_BUILDKIT=1`. | |
# | |
# `RUN --mount=... apt install <PKGS>` should finish immediately even when some packages are added to <PKGS> or built with `docker build --no-cache`. | |
FROM ubuntu | |
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache | |
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked --mount=type=cache,target=/var/lib/apt,sharing=locked \ | |
apt update && apt install -y gcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import torch | |
from torch import nn | |
from torch.autograd import Variable | |
from torch.utils.data import DataLoader | |
from torchvision import transforms | |
from torchvision.datasets import MNIST | |
from torchvision.utils import save_image |