summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorJack J. Woehr <jwoehr@softwoehr.com>2019-10-19 16:32:54 -0600
committerJack J. Woehr <jwoehr@softwoehr.com>2019-10-19 16:32:54 -0600
commit263f6169339686e723d645c60ae5ea9fe87c7e9d (patch)
tree9ab796f2aea3c5832a5bdacf9d8795505bf377d9 /numpy
parent0906162fd49f57679009cce791fa4e58ad905c6a (diff)
downloadnumpy-263f6169339686e723d645c60ae5ea9fe87c7e9d.tar.gz
changed test to assert_allclose() the output values
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_einsum.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/core/tests/test_einsum.py b/numpy/core/tests/test_einsum.py
index 9d6b39407..1b5b4cb26 100644
--- a/numpy/core/tests/test_einsum.py
+++ b/numpy/core/tests/test_einsum.py
@@ -5,7 +5,7 @@ import itertools
import numpy as np
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_almost_equal,
- assert_raises, suppress_warnings, assert_raises_regex
+ assert_raises, suppress_warnings, assert_raises_regex, assert_allclose
)
# Setup for optimize einsum
@@ -704,7 +704,9 @@ class TestEinsum(object):
# Issues gh-14692 and gh-12689
# Bug with signed vs unsigned char errored on power9 and s390x Linux
tensor = np.random.random_sample((10, 10, 10, 10))
- print(np.einsum('ijij->', tensor))
+ x = np.einsum('ijij->', tensor)
+ y = tensor.trace(axis1=0, axis2=2).trace()
+ assert_allclose(x, y)
def test_einsum_all_contig_non_contig_output(self):
# Issue gh-5907, tests that the all contiguous special case