1 from __future__
import absolute_import
2 from __future__
import division
3 from __future__
import print_function
4 from __future__
import unicode_literals
13 pytorch_test_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
14 sys.path.insert(-1, pytorch_test_dir)
16 from common_utils
import *
21 def _skipper(condition, reason):
24 def wrapper(*args, **kwargs):
26 raise unittest.SkipTest(reason)
27 return f(*args, **kwargs)
33 'CUDA is not available')
35 skipIfTravis = _skipper(
lambda: os.getenv(
'TRAVIS'),
40 return tuple(function._iter_filter(
lambda o: isinstance(o, torch.Tensor))(x))
def set_default_tensor_type(t)