Skip to content

Commit

Permalink
added initialization schemes in torch.nn.init (pytorch#833)
Browse files Browse the repository at this point in the history
  • Loading branch information
alykhantejani authored and apaszke committed Mar 1, 2017
1 parent c76770f commit 37e0548
Show file tree
Hide file tree
Showing 5 changed files with 575 additions and 33 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ install:
- export CC="ccache gcc-4.8"
- export CXX="ccache g++-4.8"
- ccache --show-stats
- travis_retry pip install -r requirements.txt
- travis_retry pip install --upgrade pip setuptools wheel
- travis_retry pip install -r requirements.txt --only-binary=scipy
- python setup.py install

script:
Expand Down
19 changes: 19 additions & 0 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import argparse
import unittest
import contextlib
from functools import wraps
from itertools import product
from copy import deepcopy

Expand Down Expand Up @@ -31,6 +32,24 @@ def run_tests():
except ImportError:
TEST_NUMPY = False

TEST_SCIPY = True
try:
import scipy
except ImportError:
TEST_SCIPY = False


def skipIfNoLapack(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
try:
fn(*args, **kwargs)
except Exception as e:
if 'Lapack library not found' in e.args[0]:
raise unittest.SkipTest('Compiled without Lapack')
raise
return wrapper


def get_cpu_type(t):
assert t.__module__ == 'torch.cuda'
Expand Down
Loading

0 comments on commit 37e0548

Please sign in to comment.