Skip to content

Instantly share code, notes, and snippets.

View soumith's full-sized avatar

Soumith Chintala soumith

View GitHub Profile
$ CUDA_VISIBLE_DEVICES=0 th -lcutorch -e "cutorch.test('sigmoid1')"
seed: 1471924845
Running 1 test
1/1 sigmoid1 ............................................................ [WAIT]torch.CudaTensor
input CPU: 0.31726333498955
input GPU: 0.31726333498955
Result CPU: 0.57865715026855
Result GPU: 0.5786572098732
torch.CudaDoubleTensor
input CPU: 0.31726332521066
import torch.multiprocessing as mp
from torch.multiprocessing import Semaphore
import sys
if sys.version_info[0] == 3:
Barrier = mp.Barrier
else: # version 2
# from http://stackoverflow.com/a/26703365/117844
class Barrier:
import torch
import torch.nn as nn
import torch.nn.parallel
class DCGAN_D(nn.Container):
def __init__(self, isize, nz, nc, ndf, ngpu, n_extra_layers=0):
super(DCGAN_D, self).__init__()
self.ngpu = ngpu
assert isize % 16 == 0, "isize has to be a multiple of 16"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable as Var
class TreeDecoder(nn.Module):
NODE_DICT, NODE_LIST, NODE_STR = 0, 1, 2
def __init__(self, input_size, max_key, max_ident, max_depth, max_length):
super(TreeDecoder, self).__init__()
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
BATCH_SIZE = 1
INPUT_DIM = 1
OUTPUT_DIM = 1
DTYPE = np.float32
@soumith
soumith / out.log
Created February 12, 2018 21:57 — forked from anonymous/out.log
[WARNING]: No mapping options supplied. 'Naive' options will be used which might fail compilation
[WARNING]: Autotuning results won't be cached. 'cache' option is not specified
[WARNING]: Using naive options for autotuning
template<typename T> inline __device__ T floord(T n, T d) {
return n < 0 ? - (-n + d - 1)/d : n / d;
}
// Halide type handling
typedef int int32;
@soumith
soumith / foo
Created February 18, 2018 06:42
Scopes 0.3.1 backport https://github.com/pytorch/pytorch/pull/5153
Cherry pick dataloader issue fix to 0.3.1 https://github.com/pytorch/pytorch/pull/5140
Fixed double memory accesses of several pointwise operations. https://github.com/pytorch/pytorch/pull/5068
Broadcast output requires_grad only if corresponding input requires_grad https://github.com/pytorch/pytorch/pull/5061
Fix topk work size computation https://github.com/pytorch/pytorch/pull/5053
Fix maxpool3d / avgpool3d crashs https://github.com/pytorch/pytorch/pull/5052
Fix blas addmm (gemm) condition check https://github.com/pytorch/pytorch/pull/5048
Fix C FFI extension after moving TH to C++ https://github.com/pytorch/pytorch/pull/5005
make torch.set_num_threads also set MKL threads (take 2) https://github.com/pytorch/pytorch/pull/5002
Fix reduction functions to respect the stride of the output https://github.com/pytorch/pytorch/pull/4995
import torch
import torch.nn as nn
from torch.autograd import Variable
torch.manual_seed(1)
# do gradcheck
N = 1
C = 1
D = 1
H = 2
W = 1
FROM nvidia/cuda:8.0-devel-centos7
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
RUN yum install -y wget curl perl cmake util-linux xz bzip2 git
RUN yum install -y patch
RUN yum install -y yum-utils centos-release-scl