@@ -633,7 +633,7 @@ def test_invalid_shape(self, shape, dtype):
633
633
dp_array = dpnp .arange (10 , dtype = dtype )
634
634
dp_out = dpnp .empty (shape , dtype = dtype )
635
635
636
- with pytest .raises (TypeError ):
636
+ with pytest .raises (ValueError ):
637
637
dpnp .ceil (dp_array , out = dp_out )
638
638
639
639
@@ -673,7 +673,7 @@ def test_invalid_shape(self, shape, dtype):
673
673
dp_array = dpnp .arange (10 , dtype = dtype )
674
674
dp_out = dpnp .empty (shape , dtype = dtype )
675
675
676
- with pytest .raises (TypeError ):
676
+ with pytest .raises (ValueError ):
677
677
dpnp .floor (dp_array , out = dp_out )
678
678
679
679
@@ -713,7 +713,7 @@ def test_invalid_shape(self, shape, dtype):
713
713
dp_array = dpnp .arange (10 , dtype = dtype )
714
714
dp_out = dpnp .empty (shape , dtype = dtype )
715
715
716
- with pytest .raises (TypeError ):
716
+ with pytest .raises (ValueError ):
717
717
dpnp .trunc (dp_array , out = dp_out )
718
718
719
719
@@ -765,9 +765,15 @@ def test_out_dtypes(self, dtype):
765
765
@pytest .mark .parametrize ("dtype" , get_all_dtypes (no_none = True ))
766
766
def test_out_overlap (self , dtype ):
767
767
size = 1 if dtype == dpnp .bool else 15
768
+ # DPNP
768
769
dp_a = dpnp .arange (2 * size , dtype = dtype )
769
- with pytest .raises (TypeError ):
770
- dpnp .add (dp_a [size ::], dp_a [::2 ], out = dp_a [:size :])
770
+ dpnp .add (dp_a [size ::], dp_a [::2 ], out = dp_a [:size :])
771
+
772
+ # original
773
+ np_a = numpy .arange (2 * size , dtype = dtype )
774
+ numpy .add (np_a [size ::], np_a [::2 ], out = np_a [:size :])
775
+
776
+ assert_allclose (np_a , dp_a )
771
777
772
778
@pytest .mark .parametrize (
773
779
"dtype" , get_all_dtypes (no_bool = True , no_none = True )
@@ -791,7 +797,7 @@ def test_invalid_shape(self, shape):
791
797
dp_array2 = dpnp .arange (5 , 15 )
792
798
dp_out = dpnp .empty (shape )
793
799
794
- with pytest .raises (TypeError ):
800
+ with pytest .raises (ValueError ):
795
801
dpnp .add (dp_array1 , dp_array2 , out = dp_out )
796
802
797
803
@pytest .mark .parametrize (
@@ -854,9 +860,15 @@ def test_out_dtypes(self, dtype):
854
860
@pytest .mark .parametrize ("dtype" , get_all_dtypes (no_none = True ))
855
861
def test_out_overlap (self , dtype ):
856
862
size = 1 if dtype == dpnp .bool else 15
863
+ # DPNP
857
864
dp_a = dpnp .arange (2 * size , dtype = dtype )
858
- with pytest .raises (TypeError ):
859
- dpnp .multiply (dp_a [size ::], dp_a [::2 ], out = dp_a [:size :])
865
+ dpnp .multiply (dp_a [size ::], dp_a [::2 ], out = dp_a [:size :])
866
+
867
+ # original
868
+ np_a = numpy .arange (2 * size , dtype = dtype )
869
+ numpy .multiply (np_a [size ::], np_a [::2 ], out = np_a [:size :])
870
+
871
+ assert_allclose (np_a , dp_a )
860
872
861
873
@pytest .mark .parametrize (
862
874
"dtype" , get_all_dtypes (no_bool = True , no_none = True )
@@ -880,7 +892,7 @@ def test_invalid_shape(self, shape):
880
892
dp_array2 = dpnp .arange (5 , 15 )
881
893
dp_out = dpnp .empty (shape )
882
894
883
- with pytest .raises (TypeError ):
895
+ with pytest .raises (ValueError ):
884
896
dpnp .multiply (dp_array1 , dp_array2 , out = dp_out )
885
897
886
898
@pytest .mark .parametrize (
0 commit comments