Theano/libgpuarray

FAIL: pygpu.tests.test_elemwise.test_divmod('int8', 'float32', (50,))

Opened this issue · 4 comments

helq commented

After installing libgpuarray and runnig the tests I got this error:

$ DEVICE=cuda python2 -c "import pygpu.tests.test_elemwise; pygpu.tests.test_elemwise.divmod_array('int8', 'float32', (50,))"
*** Testing for GeForce GTX TITAN X
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/elacruzca/.local/lib/python2.7/site-packages/pygpu-0.6.5-py2.7-linux-x86_64.egg/pygpu/tests/support.py", line 39, in f
    func(*args, **kwargs)
  File "/home/elacruzca/.local/lib/python2.7/site-packages/pygpu-0.6.5-py2.7-linux-x86_64.egg/pygpu/tests/test_elemwise.py", line 236, in divmod_array
    assert numpy.allclose(out_c[1], numpy.asarray(out_g[1]))
AssertionError

No other test fails.

pygpu version 0.6.5

nouiz commented
helq commented

These are the values:

print out_c[1]
[ 2.          2.96456456  1.80960321  1.          2.          5.          1.
  0.37324905  4.          2.          2.          4.          5.          6.
  0.          1.09210575  2.92230988  4.          2.          1.31337512
  1.          2.          0.31895924  2.          4.          1.
  2.18828678  0.          0.35755444  0.          0.76005101  5.
  0.48180008  5.          2.69929767  6.          5.          0.          8.
  2.          5.          3.          0.          7.          9.
  1.02005863  2.          1.          1.64588308  0.27146184]

print numpy.asarray(out_g[1])
[ 2.          2.96456456  1.80960321  1.          2.          5.          1.
  0.37324905  4.          2.          2.          4.          5.          6.
         nan  1.09210575  2.92230988  4.          2.          1.31337512
  1.          2.          0.31895924  2.          4.          1.
  2.18828678         nan  0.35755444         nan  0.76005101  5.
  0.48180008  5.          2.69929767  6.          5.                 nan
  8.          2.          5.          3.                 nan  7.          9.
  1.02005863  2.          1.          1.64588308  0.27146184]

print out_g[1]
[ 2.          2.96456456  1.80960321  1.          2.          5.          1.
  0.37324905  4.          2.          2.          4.          5.          6.
         nan  1.09210575  2.92230988  4.          2.          1.31337512
  1.          2.          0.31895924  2.          4.          1.
  2.18828678         nan  0.35755444         nan  0.76005101  5.
  0.48180008  5.          2.69929767  6.          5.                 nan
  8.          2.          5.          3.                 nan  7.          9.
  1.02005863  2.          1.          1.64588308  0.27146184]

It's probably just because nan != nan. Maybe we should adjust the input values to avoid nans.

Or rather, we get nans instead of 0. That a bit worse.