This file contains hidden or 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
$ 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 |
This file contains hidden or 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 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: |
This file contains hidden or 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 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.
This file contains hidden or 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 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__() |
This file contains hidden or 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 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 |
This file contains hidden or 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
[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; |
This file contains hidden or 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
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 |
This file contains hidden or 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 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 |
This file contains hidden or 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
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 |