Skip to content

Instantly share code, notes, and snippets.

View soumith's full-sized avatar

Soumith Chintala soumith

View GitHub Profile
import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
# self.conv1 = nn.Conv2d(1, 31, 3, 2)
self.bn1 = nn.BatchNorm2d(1)
def forward(self, x):
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
def forward(self, x):
y = torch.sigmoid(x + x * x)
return y
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision as vision
class XlaMNIST(nn.Module):
def __init__(self):
super(XlaMNIST, self).__init__()
# self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
# self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision as vision
class XlaMNIST(nn.Module):
def __init__(self):
super(XlaMNIST, self).__init__()
def forward(self, x):
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision as vision
class XlaMNIST(nn.Module):
def __init__(self):
super(XlaMNIST, self).__init__()
self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
WORKDIR /packages
RUN apt-get update --fix-missing && \
apt-get install -y cmake git wget bzip2 ca-certificates curl software-properties-common && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get update && \
apt-get install -y gcc-7 libgfortran4 && \
apt-get clean
graph(%0 : Float(4, 3, 224, 224)
%1 : Float(64, 3, 7, 7)
%2 : Float(64)
%3 : Float(64)
%4 : Float(64)
%5 : Float(64)
%6 : Long()
%7 : Float(64, 64, 1, 1)
%8 : Float(64)
%9 : Float(64)
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import datasets, transforms
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
@soumith
soumith / gist:01da3874bf014d8a8c53406c2b95d56b
Last active March 28, 2022 16:53
Install PillowSIMD+libjpeg-turbo on Conda
conda uninstall --force pillow -y
# install libjpeg-turbo to $HOME/turbojpeg
git clone https://github.com/libjpeg-turbo/libjpeg-turbo
pushd libjpeg-turbo
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=$HOME/turbojpeg
make
make install
================================================================================
General dependencies
================================================================================
libc.so.6 imported symbols from:
python
ld-linux-x86-64.so.2
libpthread.so.0
sh
libm.so.6 imported symbols from:
libc.so.6