提交 6e39a60b authored 作者: Frederic's avatar Frederic

fix test when config.blas.ldflags is empty.

上级 76f2757a
...@@ -2,6 +2,8 @@ import sys ...@@ -2,6 +2,8 @@ import sys
import numpy import numpy
from unittest import TestCase from unittest import TestCase
from nose.plugins.skip import SkipTest
import theano import theano
import theano.tensor as tensor import theano.tensor as tensor
...@@ -25,6 +27,10 @@ mode_blas_opt = theano.compile.get_default_mode().including( ...@@ -25,6 +27,10 @@ mode_blas_opt = theano.compile.get_default_mode().including(
class TestCGer(TestCase, TestOptimizationMixin): class TestCGer(TestCase, TestOptimizationMixin):
def setUp(self, dtype='float64'): def setUp(self, dtype='float64'):
if theano.config.blas.ldflags == "":
raise SkipTest("This test is useful only when Theano"
" is directly linked to blas.")
self.dtype = dtype self.dtype = dtype
self.mode = theano.compile.get_default_mode().including('fast_run') self.mode = theano.compile.get_default_mode().including('fast_run')
self.A = tensor.tensor(dtype=dtype, broadcastable=(False, False)) self.A = tensor.tensor(dtype=dtype, broadcastable=(False, False))
...@@ -105,6 +111,9 @@ class TestCGemv(TestCase, TestOptimizationMixin): ...@@ -105,6 +111,9 @@ class TestCGemv(TestCase, TestOptimizationMixin):
""" """
def setUp(self, dtype='float64'): def setUp(self, dtype='float64'):
if theano.config.blas.ldflags == "":
raise SkipTest("This test is useful only when Theano"
" is directly linked to blas.")
self.dtype = dtype self.dtype = dtype
self.mode = theano.compile.get_default_mode().including('fast_run') self.mode = theano.compile.get_default_mode().including('fast_run')
# matrix # matrix
...@@ -234,6 +243,11 @@ class TestCGemvFloat32(TestCase, BaseGemv, TestOptimizationMixin): ...@@ -234,6 +243,11 @@ class TestCGemvFloat32(TestCase, BaseGemv, TestOptimizationMixin):
gemv = CGemv(inplace=False) gemv = CGemv(inplace=False)
gemv_inplace = CGemv(inplace=True) gemv_inplace = CGemv(inplace=True)
def setUp(self):
if theano.config.blas.ldflags == "":
raise SkipTest("This test is useful only when Theano"
" is directly linked to blas.")
class TestCGemvFloat64(TestCase, BaseGemv, TestOptimizationMixin): class TestCGemvFloat64(TestCase, BaseGemv, TestOptimizationMixin):
mode = mode_blas_opt mode = mode_blas_opt
...@@ -241,6 +255,11 @@ class TestCGemvFloat64(TestCase, BaseGemv, TestOptimizationMixin): ...@@ -241,6 +255,11 @@ class TestCGemvFloat64(TestCase, BaseGemv, TestOptimizationMixin):
gemv = CGemv(inplace=False) gemv = CGemv(inplace=False)
gemv_inplace = CGemv(inplace=True) gemv_inplace = CGemv(inplace=True)
def setUp(self):
if theano.config.blas.ldflags == "":
raise SkipTest("This test is useful only when Theano"
" is directly linked to blas.")
class TestBlasStridesC(TestBlasStrides): class TestBlasStridesC(TestBlasStrides):
mode = mode_blas_opt mode = mode_blas_opt
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论