Skip to content

Commit

Permalink
test: add some assumptions for dim values in test_torch_diag to ensur…
Browse files Browse the repository at this point in the history
…e both dims are not the same
  • Loading branch information
Ishticode committed Feb 18, 2024
1 parent 9fbdbcc commit 3d3ba73
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ivy_tests/test_ivy/test_frontends/test_torch/test_linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import math
import sys
import numpy as np
from hypothesis import strategies as st, assume
from hypothesis import strategies as st, assume, settings, HealthCheck

# local
import ivy
Expand Down Expand Up @@ -435,6 +435,7 @@ def test_torch_det(
ensure_dim_unique=True,
),
)
@settings(suppress_health_check=list(HealthCheck))
def test_torch_diag_embed(
*,
dtype_and_values,
Expand All @@ -447,6 +448,11 @@ def test_torch_diag_embed(
):
input_dtype, value = dtype_and_values
dim1, dim2, offset = dims_and_offsets
num_of_dims = len(np.shape(value[0]))
if dim1 < 0:
assume(dim1 + num_of_dims != dim2)
if dim2 < 0:
assume(dim1 != dim2 + num_of_dims)
helpers.test_frontend_function(
input_dtypes=input_dtype,
backend_to_test=backend_fw,
Expand Down

0 comments on commit 3d3ba73

Please sign in to comment.