function | Symbolic_implemented |
---|---|
gather | |
equal | |
__and__ , __iand__ , __or__ , __ior__ , __xor__ , __ixor__ , __lshift__ , __ilshift__ , __rshift__ , __irshift__ |
|
min, max | |
all | |
any | |
frac | yes |
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
#!/usr/bin/env torch | |
require 'nn' | |
require 'image' | |
require 'xlua' | |
require 'pl' | |
opt = lapp[[ | |
-t,--threads (default 8) number of threads | |
-p,--type (default float) float or cuda |
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
-- multiple learning rates per network. Optimizes two copies of a model network and checks if the optimization steps (2) and (3) produce the same weights/parameters. | |
require 'torch' | |
require 'nn' | |
require 'optim' | |
torch.setdefaulttensortype('torch.FloatTensor') | |
-- (1) Define a model for this example. | |
local model = nn.Sequential() | |
model:add(nn.Linear(10,20)) |
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" |
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; |