@@ -164,7 +164,6 @@ def test_divide_shapes(shape: tuple) -> None:
164
164
"""Test division operation between two arrays of the same shape"""
165
165
lhs = wrapper .randu (shape , dtype .f16 )
166
166
rhs = wrapper .randu (shape , dtype .f16 )
167
- # Ensure no division by zero for test integrity
168
167
rhs = wrapper .add (rhs , wrapper .constant (0.001 , shape , dtype .f16 ))
169
168
170
169
result = wrapper .div (lhs , rhs )
@@ -208,31 +207,12 @@ def test_divide_supported_dtypes(dtype_name: dtype.Dtype) -> None:
208
207
shape = (5 , 5 )
209
208
lhs = wrapper .randu (shape , dtype_name )
210
209
rhs = wrapper .randu (shape , dtype_name )
211
- # Ensure no division by zero for test integrity
212
210
rhs = wrapper .add (rhs , wrapper .constant (0.001 , shape , dtype_name ))
213
211
214
212
result = wrapper .div (lhs , rhs )
215
213
assert dtype .c_api_value_to_dtype (wrapper .get_type (result )) == dtype_name , f"Failed for dtype: { dtype_name } "
216
214
217
215
218
- def test_divide_by0 () -> None :
219
- """Test division operation for undefined error type."""
220
- shape = (2 , 2 )
221
- lhs = wrapper .constant (5 , shape , dtype .f16 )
222
- rhs = wrapper .constant (0 , shape , dtype .f16 )
223
- lhsnp = np .full (shape , 5 )
224
- rhsnp = np .zeros (shape )
225
- out = np .divide (lhsnp , rhsnp )
226
- print (out )
227
- with pytest .raises (RuntimeError ):
228
- divOut = wrapper .div (lhs , rhs )
229
- print (array_to_string ("" , divOut , 3 , False ))
230
- wrapper .div (lhs , rhs )
231
-
232
- # result = wrapper.div(lhs, rhs)
233
- # assert dtype.c_api_value_to_dtype(wrapper.get_type(result)) == dtype_name, f"Failed for dtype: {dtype_name}"
234
-
235
-
236
216
@pytest .mark .parametrize (
237
217
"invdtypes" ,
238
218
[
0 commit comments