Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test/custom: test np.norm for custom types
Browse files Browse the repository at this point in the history
jcarpent committed Jan 9, 2025
1 parent fd0ed61 commit 1b3d12e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions unittest/python/test_user_type.py
Original file line number Diff line number Diff line change
@@ -44,6 +44,11 @@ def test(dtype):
mat2 = np.matmul(mat, mat.T)
assert np.isclose(mat2.astype(np.double), mat2_ref).all()

vec = np.ones((rows,), dtype=dtype)
norm = np.norm(vec)
norm_ref = np.norm(vec.astype(np.double))
assert norm == norm_ref


def test_cast(from_dtype, to_dtype):
np.can_cast(from_dtype, to_dtype)

0 comments on commit 1b3d12e

Please sign in to comment.