Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update test
  • Loading branch information
guilhermeleobas committed Sep 21, 2021
commit a343c6e892e787d4a8c8adae820c8df8c23596b9
6 changes: 4 additions & 2 deletions numba/tests/npyufunc/test_gufunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,22 @@ def my_cumsum(x, res):
my_cumsum(x, out=out_kw, axis=0)
np.testing.assert_equal(out_kw, expected)

def test_attrs(self):
def test_gufunc_attributes(self):
@guvectorize("(n)->(n)")
def gufunc(x, res):
acc = 0
for i in range(x.shape[0]):
acc += x[i]
res[i] = acc

# ensure gufunc exports attributes
attrs = ['signature', 'accumulate', 'at', 'outer', 'reduce', 'reduceat']
for attr in attrs:
# ensure gufunc exports the propertie above
contains = hasattr(gufunc, attr)
self.assertTrue(contains, 'dynamic gufunc not exporting "%s"' % (attr,))

self.assertEqual(gufunc.signature, "(n)->(n)")


class TestGUVectorizeScalar(TestCase):
"""
Expand Down