@@ -385,15 +385,27 @@ def test_trunc_shapes_invalid(invdtypes: dtype.Dtype) -> None:
385
385
(random .randint (1 , 10 ), random .randint (1 , 10 ), random .randint (1 , 10 ), random .randint (1 , 10 )),
386
386
],
387
387
)
388
- @pytest .mark .parametrize ("dtype_name" , util .get_all_types ())
389
- def test_hypot_shape_dtypes (shape : tuple , dtype_name : dtype .Dtype ) -> None :
388
+ def test_hypot_shape_dtypes (shape : tuple ) -> None :
390
389
"""Test hypotenuse operation between two arrays of the same shape"""
391
- util .check_type_supported (dtype_name )
392
- lhs = wrapper .randu (shape , dtype_name )
393
- rhs = wrapper .randu (shape , dtype_name )
390
+ lhs = wrapper .randu (shape , dtype .f32 )
391
+ rhs = wrapper .randu (shape , dtype .f32 )
394
392
395
- result = wrapper .hypot (lhs , rhs )
393
+ result = wrapper .hypot (lhs , rhs , True )
396
394
397
395
assert (
398
396
wrapper .get_dims (result )[0 : len (shape )] == shape # noqa
399
- ), f"failed for shape: { shape } and dtype { dtype_name } "
397
+ ), f"failed for shape: { shape } and dtype { dtype .f32 } "
398
+ @pytest .mark .parametrize (
399
+ "invdtypes" ,
400
+ [
401
+ dtype .int32 ,
402
+ dtype .uint32 ,
403
+ ],
404
+ )
405
+ def test_hypot_unsupported_dtypes (invdtypes : dtype .Dtype ) -> None :
406
+ """Test division operation for unsupported data types."""
407
+ with pytest .raises (RuntimeError ):
408
+ shape = (5 , 5 )
409
+ lhs = wrapper .randu (shape , invdtypes )
410
+ rhs = wrapper .randu (shape , invdtypes )
411
+ wrapper .hypot (rhs , lhs , True )
0 commit comments