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
class Any { | |
public: | |
template<typename T> | |
explicit Any(T&& value) : content_(new Holder<T>(std::forward<T>(value))) {} | |
Any(const Any& other) : content_(other.content_->clone()) {} | |
Any(Any&& other) { swap(other); } | |
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
Skipping /home/psag/pytorch/pytorch/torch/csrc/api/include/torch/optimizers.h. Compile command not found. | |
Skipping /home/psag/pytorch/pytorch/torch/csrc/api/include/torch/serialization.h. Compile command not found. | |
Skipping /home/psag/pytorch/pytorch/torch/csrc/api/include/torch/torch.h. Compile command not found. | |
Skipping /home/psag/pytorch/pytorch/torch/csrc/api/include/torch/detail.h. Compile command not found. | |
Skipping /home/psag/pytorch/pytorch/torch/csrc/api/include/torch/nn/module.h. Compile command not found. | |
Skipping /home/psag/pytorch/pytorch/torch/csrc/api/include/torch/nn/modules/conv.h. Compile command not found. | |
Skipping /home/psag/pytorch/pytorch/torch/csrc/api/include/torch/nn/modules/modules.h. Compile command not found. | |
Skipping /home/psag/pytorch/pytorch/torch/csrc/api/include/torch/nn/modules/functional.h. Compile command not found. | |
Skipping /home/psag/pytorch/pytorch/torch/csrc/api/include/torch/nn/modules/batchnorm.h. Compile command not found. | |
Skipping /home/psag/pytorch/pytorch/torch/c |
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
AUTOGRAD_CONTAINER_CLASS(DefoggerModel) { | |
// Multi level LSTM model from starcraft_defogger. | |
public: | |
struct Parameters { | |
int map_embsize = 64; | |
int race_embsize = 8; | |
int dec_convsize = 3; | |
int dec_depth = 3; | |
int dec_embsize = 128; | |
int hid_dim = 256; |
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
const int kRuns = 1000; | |
const int kWarmUp = 100000; | |
void benchmark() { | |
using clock = std::chrono::high_resolution_clock; | |
using duration = std::chrono::duration<double, std::micro>; | |
auto x = make_variable(CPU(kFloat).randn({10, 10}), true); | |
backward(x.sum()); |
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
# Instructions for installing GCC 4.9 on various platforms. | |
# The commands show instructions for GCC 4.9, but any higher version will also work! | |
# Ubuntu (https://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-on-ubuntu/581497#581497) | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install gcc-4.9 g++-4.9 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 |
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/autograd/autograd.h b/torch/csrc/autograd/autograd.h | |
index f04b472e..7ff9a39f 100644 | |
--- a/torch/csrc/autograd/autograd.h | |
+++ b/torch/csrc/autograd/autograd.h | |
@@ -2,12 +2,14 @@ | |
#define THP_AUTOGRAD_H | |
PyObject * THPAutograd_initExtension(PyObject *_unused); | |
-bool THPAutograd_initFunctions(PyObject* module); | |
+void THPAutograd_initFunctions(); |
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
test_RNGState (test_torch.TestTorch) ... ok | |
test_RNGStateAliasing (test_torch.TestTorch) ... ok | |
test_Size (test_torch.TestTorch) ... ok | |
test_abs (test_torch.TestTorch) ... ok | |
test_accreal_type (test_torch.TestTorch) ... ok | |
test_acos (test_torch.TestTorch) ... ok | |
test_add (test_torch.TestTorch) ... ok | |
test_addbmm (test_torch.TestTorch) ... ok | |
test_addmm (test_torch.TestTorch) ... ok | |
test_addmv (test_torch.TestTorch) ... ok |
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
macro_rules! hex { | |
(0) => {48}; | |
(9) => {57}; | |
(A) => {65}; | |
(F) => {70}; | |
(a) => {97}; | |
(z) => {102}; | |
(0..9) => {48...57}; | |
(A..F) => {65...70}; | |
(a..f) => {97...102}; |
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 numpy as np | |
np.random.seed(42) | |
def sigmoid(z): | |
return 1 / (1 + np.exp(-z)) | |
def d_sigmoid(z): |
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 argparse | |
import collections | |
import datetime | |
import math | |
import numpy as np | |
import os | |
import sys | |
import tensorflow as tf | |
import time | |
import warnings |