Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Enable float32 data type in linalg cholesky test #20508

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
12 changes: 7 additions & 5 deletions tests/python/unittest/test_numpy_interoperability.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,13 @@ def _add_workload_linalg_cholesky():
for shape, dtype in itertools.product(shapes, dtypes):
a = _np.random.randn(*shape)

t = list(range(len(shape)))
t[-2:] = -1, -2
t = list(range(len(shape)))
t[-2:] = -1, -2

a = _np.matmul(a.transpose(t).conj(), a)
a = _np.matmul(a.transpose(t).conj(), a)
a = _np.asarray(a, dtype=dtype)

OpArgMngr.add_workload('linalg.cholesky', np.array(a, dtype=dtype))
OpArgMngr.add_workload('linalg.cholesky', np.array(a, dtype=dtype))

# test_0_size
for dtype in dtypes:
Expand Down Expand Up @@ -3306,7 +3307,8 @@ def check_interoperability(op_list):
continue
default_tols = (1e-3, 1e-4)
tols = {'linalg.tensorinv': (1e-2, 5e-3),
'linalg.solve': (1e-3, 5e-2)}
'linalg.solve': (1e-3, 5e-2),
'linalg.cholesky': (1e-1, 1e-1)}
(rel_tol, abs_tol) = tols.get(name, default_tols)
print('Dispatch test:', name)
workloads = OpArgMngr.get_workloads(name)
Expand Down