Skip to content

Instantly share code, notes, and snippets.

View victordeleau's full-sized avatar
_______________________________________________

Victor Deleau victordeleau

_______________________________________________
View GitHub Profile
@AkihiroSuda
AkihiroSuda / Dockerfile
Created July 24, 2018 07:11
Docker v18.06 `RUN --mount=type=cache` example (keep /var/cache/apt)
# 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
@bigsnarfdude
bigsnarfdude / dae_pytorch_cuda.py
Created December 9, 2017 00:17
denoising autoencoder pytorch cuda
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