提交 63a59ac1 authored 作者: nouiz's avatar nouiz

Merge pull request #275 from delallea/win_py24

More fixes for Windows
...@@ -726,7 +726,7 @@ Currently, due to memory fragmentation issue in Windows, the ...@@ -726,7 +726,7 @@ Currently, due to memory fragmentation issue in Windows, the
test-suite breaks at some point when using ``nosetests``, with many error test-suite breaks at some point when using ``nosetests``, with many error
messages looking messages looking
like: ``DLL load failed: Not enough storage is available to process this like: ``DLL load failed: Not enough storage is available to process this
command``. As a result, you should instead run command``. As a workaround, you can instead run:
.. code-block:: bash .. code-block:: bash
...@@ -736,6 +736,13 @@ This will run tests in batches of 100, which should avoid memory errors. ...@@ -736,6 +736,13 @@ This will run tests in batches of 100, which should avoid memory errors.
Note that this script calls ``nosetests``, which may require being run from Note that this script calls ``nosetests``, which may require being run from
within a MinGW shell if you installed Nose manually as described above. within a MinGW shell if you installed Nose manually as described above.
.. note::
The above workaround to run tests with the ``run_tests_in_batch.py`` script
is currently imperfect: some tests are not properly collected by nosetests
in this mode. This may result in some weird test failures starting with
``ERROR: Failure: OSError``. We do not yet have a fix for this problem.
Editing code in Visual Studio Editing code in Visual Studio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
...@@ -555,6 +555,12 @@ class test_structureddot(unittest.TestCase): ...@@ -555,6 +555,12 @@ class test_structureddot(unittest.TestCase):
class DotTests(unittest.TestCase): class DotTests(unittest.TestCase):
def setUp(self): def setUp(self):
# On 32-bit platforms we use smaller matrices to avoid running out of
# memory during tests.
if theano.gof.cmodule.local_bitwidth() <= 32:
x_size = (10, 100)
y_size = (100, 1000)
else:
x_size = (10, 1000) x_size = (10, 1000)
y_size = (1000, 10000) y_size = (1000, 10000)
......
...@@ -372,6 +372,7 @@ def rand_of_dtype(shape, dtype): ...@@ -372,6 +372,7 @@ def rand_of_dtype(shape, dtype):
def makeBroadcastTester(op, expected, checks={}, name=None, **kwargs): def makeBroadcastTester(op, expected, checks={}, name=None, **kwargs):
if name is None:
name = str(op) name = str(op)
# Here we ensure the test name matches the name of the variable defined in # Here we ensure the test name matches the name of the variable defined in
# this script. This is needed to properly identify the test e.g. with the # this script. This is needed to properly identify the test e.g. with the
...@@ -628,6 +629,7 @@ CeilIntDivTester = makeBroadcastTester( ...@@ -628,6 +629,7 @@ CeilIntDivTester = makeBroadcastTester(
uinteger=(randint(2, 3).astype("uint8"), uinteger=(randint(2, 3).astype("uint8"),
randint_nonzero(2, 3).astype("uint8")), randint_nonzero(2, 3).astype("uint8")),
), ),
name='CeilIntDiv',
# As we implement this function with neq, the gradient returned is always 0. # As we implement this function with neq, the gradient returned is always 0.
# grad=_grad_broadcast_div_mod_normal, # grad=_grad_broadcast_div_mod_normal,
# grad_rtol=div_grad_rtol, # grad_rtol=div_grad_rtol,
...@@ -674,10 +676,13 @@ _grad_broadcast_pow_normal = dict(same_shapes = (rand_ranged(1, 5, (2, 3)), rand ...@@ -674,10 +676,13 @@ _grad_broadcast_pow_normal = dict(same_shapes = (rand_ranged(1, 5, (2, 3)), rand
_good_broadcast_pow_normal_float_pow = copy(_good_broadcast_pow_normal_float) _good_broadcast_pow_normal_float_pow = copy(_good_broadcast_pow_normal_float)
del _good_broadcast_pow_normal_float_pow["empty2"] del _good_broadcast_pow_normal_float_pow["empty2"]
PowTester = makeBroadcastTester(op = pow, PowTester = makeBroadcastTester(
expected = lambda x, y: check_floatX((x, y), x ** y), op=pow,
good = _good_broadcast_pow_normal_float, expected=lambda x, y: check_floatX((x, y), x ** y),
grad = _grad_broadcast_pow_normal) good=_good_broadcast_pow_normal_float,
grad= _grad_broadcast_pow_normal,
name='Pow')
PowInplaceTester = makeBroadcastTester(op = inplace.pow_inplace, PowInplaceTester = makeBroadcastTester(op = inplace.pow_inplace,
expected = lambda x, y: x ** y, expected = lambda x, y: x ** y,
good = _good_broadcast_pow_normal_float_pow, good = _good_broadcast_pow_normal_float_pow,
...@@ -1090,15 +1095,19 @@ ErfcInplaceTester = makeBroadcastTester(op = inplace.erfc_inplace, ...@@ -1090,15 +1095,19 @@ ErfcInplaceTester = makeBroadcastTester(op = inplace.erfc_inplace,
inplace = True, inplace = True,
skip = skip_scipy) skip = skip_scipy)
ZerosLikeTester = makeBroadcastTester(op = tensor.zeros_like, ZerosLikeTester = makeBroadcastTester(
expected = numpy.zeros_like, op=tensor.zeros_like,
good = _good_broadcast_unary_normal, expected=numpy.zeros_like,
grad = _grad_broadcast_unary_normal) good=_good_broadcast_unary_normal,
grad=_grad_broadcast_unary_normal,
name='ZerosLike')
OnesLikeTester = makeBroadcastTester(op = tensor.ones_like, OnesLikeTester = makeBroadcastTester(
expected = numpy.ones_like, op=tensor.ones_like,
good = _good_broadcast_unary_normal, expected=numpy.ones_like,
grad = _grad_broadcast_unary_normal) good=_good_broadcast_unary_normal,
grad=_grad_broadcast_unary_normal,
name='OnesLike')
DotTester = makeTester(name = 'DotTester', DotTester = makeTester(name = 'DotTester',
op = dot, op = dot,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论