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
std::vector<int64_t> input_size = {4, 3, 15, 17}; // B x C x H x W | |
std::vector<int64_t> kernel_size = {3, 5}; | |
std::vector<int64_t> stride = {1, 2}; | |
std::vector<int64_t> padding = {2, 1}; | |
constexpr int out_channels = 5; | |
// make inputs | |
at::Tensor input = torch::randn(input_size); | |
at::Tensor weight = torch::randn({out_channels, input_size[1], kernel_size[0], kernel_size[1]}); | |
at::Tensor bias = torch::randn({out_channels}); |
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
diff --git a/torch/csrc/jit/autodiff.cpp b/torch/csrc/jit/autodiff.cpp | |
index 59eb7ca11..75abe0097 100644 | |
--- a/torch/csrc/jit/autodiff.cpp | |
+++ b/torch/csrc/jit/autodiff.cpp | |
@@ -77,7 +77,8 @@ bool isDifferentiable(Node * n) { | |
"aten::trunc(Tensor self) -> Tensor", | |
"aten::log_softmax(Tensor self, int dim) -> Tensor", | |
"aten::avg_pool2d(Tensor self, int[] kernel_size, int[] stride, int[] padding, bool ceil_mode, bool count_include_pad) -> Tensor", | |
- "aten::max_pool2d_with_indices(Tensor self, int[] kernel_size, int[] stride, int[] padding, int[] dilation, bool ceil_mode) -> (Tensor, Tensor)" | |
+ "aten::max_pool2d_with_indices(Tensor self, int[] kernel_size, int[] stride, int[] padding, int[] dilation, bool ceil_mode) -> (Tensor, Tensor)", |
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
diff --git a/torch/csrc/jit/autodiff.cpp b/torch/csrc/jit/autodiff.cpp | |
index 59eb7ca11..75abe0097 100644 | |
--- a/torch/csrc/jit/autodiff.cpp | |
+++ b/torch/csrc/jit/autodiff.cpp | |
@@ -77,7 +77,8 @@ bool isDifferentiable(Node * n) { | |
"aten::trunc(Tensor self) -> Tensor", | |
"aten::log_softmax(Tensor self, int dim) -> Tensor", | |
"aten::avg_pool2d(Tensor self, int[] kernel_size, int[] stride, int[] padding, bool ceil_mode, bool count_include_pad) -> Tensor", | |
- "aten::max_pool2d_with_indices(Tensor self, int[] kernel_size, int[] stride, int[] padding, int[] dilation, bool ceil_mode) -> (Tensor, Tensor)" | |
+ "aten::max_pool2d_with_indices(Tensor self, int[] kernel_size, int[] stride, int[] padding, int[] dilation, bool ceil_mode) -> (Tensor, Tensor)", |
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 time | |
import torch | |
import torchvision | |
batch_size = 128 | |
num_iterations = 10 | |
resnet50 = torchvision.models.resnet50().to(device="cuda") | |
inp = torch.randn(batch_size, 3, 224, 224, device="cuda") | |
target = torch.arange(batch_size, device="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
diff --git a/imagenet/main.py b/imagenet/main.py | |
index 20838f0..783bbf2 100644 | |
--- a/imagenet/main.py | |
+++ b/imagenet/main.py | |
@@ -20,8 +20,6 @@ model_names = sorted(name for name in models.__dict__ | |
and callable(models.__dict__[name])) | |
parser = argparse.ArgumentParser(description='PyTorch ImageNet Training') | |
-parser.add_argument('data', metavar='DIR', | |
- help='path to dataset') |
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
sudo apt-get install -y libopenblas-dev cmake ninja-build | |
sudo apt-get install -y python-pip | |
sudo pip install virtualenv | |
virtualenv pytorch-env | |
. pytorch-env/bin/activate | |
git clone https://github.com/pytorch/pytorch --recursive | |
pip install -r requirements.txt | |
python setup.py install |
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
set -e | |
# docker run -it --ipc=host --rm -v $(pwd):/remote ubuntu:xenial bash | |
# bash /remote/run_repro.sh | |
apt-get update | |
apt-get install -y build-essential wget git | |
######################################################## | |
# Setup environment | |
######################################################## |
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 | |
import torchvision | |
class XlaMNIST(nn.Module): | |
def __init__(self): | |
super(XlaMNIST, self).__init__() | |
self.conv1 = nn.Conv2d(1, 10, kernel_size=5) | |
self.bn1 = nn.BatchNorm2d(10) |
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
mkl_libs | |
mkl_libs/libmkl_gnu_thread.a | |
mkl_libs/libmkl_core.a | |
mkl_libs/include | |
mkl_libs/include/mkl_vml.f90 | |
mkl_libs/include/mkl_direct_call.h | |
mkl_libs/include/mkl_cblas.h | |
mkl_libs/include/lp64 | |
mkl_libs/include/lp64/lapack95.mod | |
mkl_libs/include/lp64/f95_precision.mod |