You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# float_tensor /= bool_scalardeftest_Assignment_True_Div_float_tensor_bool_scalar (self):
temp_np=self.np_float_0_4.copy()
temp_np/=Truetemp_dc=self.dc_float_0_4.copy()
temp_dc/=Truenp.testing.assert_array_equal(temp_np, np.array(temp_dc.data()))
# float_tensor /= int_scalar (Numpy and Dnnc has same output, but says not equal)deftest_Assignment_True_Div_float_tensor_int_scalar (self):
temp_np=self.np_float_0_4.copy()
temp_np/=5temp_dc=self.dc_float_0_4.copy()
temp_dc/=5np.testing.assert_array_equal(temp_np, np.array(temp_dc.data()))
# float_tensor /= float_scalar (Numpy and Dnnc has same output, but says not equal)deftest_Assignment_True_Div_float_tensor_float_scalar (self):
temp_np=self.np_float_0_4.copy()
temp_np/=5.0temp_dc=self.dc_float_0_4.copy()
temp_dc/=5.0np.testing.assert_array_equal(temp_np, np.array(temp_dc.data()))
# float_tensor /= float_tensor (Numpy and Dnnc has same output, but says not equal)deftest_Assignment_True_Div_float_tensor_float_tensor (self):
temp_np=self.np_float_0_4.copy()
temp_np/=self.np_float_5_9temp_dc=self.dc_float_0_4.copy()
temp_dc/=self.dc_float_5_9np.testing.assert_array_equal(temp_np, np.array(temp_dc.data()))
The tensor<float>/=tensor<bool> works, but tensor<float>/=tensor<int/float/double> doesn't. As output it shows:
gunjan@gunjan-VirtualBox:/Desktop/dnnCompiler/test/swig$ python3 tensorAssignmentOperators.py -vtest_Assignment_True_Div_float_tensor_bool_scalar (__main__.tensorAssignmentOperatorsTest) ... oktest_Assignment_True_Div_float_tensor_float_scalar (__main__.tensorAssignmentOperatorsTest) ... FAILtest_Assignment_True_Div_float_tensor_float_tensor (__main__.tensorAssignmentOperatorsTest) ... FAILtest_Assignment_True_Div_float_tensor_int_scalar (__main__.tensorAssignmentOperatorsTest) ... FAIL======================================================================FAIL: test_Assignment_True_Div_float_tensor_float_scalar (__main__.tensorAssignmentOperatorsTest)----------------------------------------------------------------------Traceback (most recent call last): File "tensorAssignmentOperators.py", line 632, in test_Assignment_True_Div_float_tensor_float_scalar np.testing.assert_array_equal(temp_np, np.array(temp_dc.data())) File "/home/gunjan/.local/lib/python3.6/site-packages/numpy/testing/_private/utils.py", line 913, in assert_array_equal verbose=verbose, header='Arrays are not equal') File "/home/gunjan/.local/lib/python3.6/site-packages/numpy/testing/_private/utils.py", line 836, in assert_array_compare raise AssertionError(msg)AssertionError: Arrays are not equalMismatch: 80%Max absolute difference: 2.38418579e-08Max relative difference: nan x: array([0. , 0.2, 0.4, 0.6, 0.8]) y: array([0. , 0.2, 0.4, 0.6, 0.8])======================================================================FAIL: test_Assignment_True_Div_float_tensor_float_tensor (__main__.tensorAssignmentOperatorsTest)----------------------------------------------------------------------Traceback (most recent call last): File "tensorAssignmentOperators.py", line 656, in test_Assignment_True_Div_float_tensor_float_tensor np.testing.assert_array_equal(temp_np, np.array(temp_dc.data())) File "/home/gunjan/.local/lib/python3.6/site-packages/numpy/testing/_private/utils.py", line 913, in assert_array_equal verbose=verbose, header='Arrays are not equal') File "/home/gunjan/.local/lib/python3.6/site-packages/numpy/testing/_private/utils.py", line 836, in assert_array_compare raise AssertionError(msg)AssertionError: Arrays are not equalMismatch: 60%Max absolute difference: 1.27724239e-08Max relative difference: nan x: array([0. , 0.166667, 0.285714, 0.375 , 0.444444]) y: array([0. , 0.166667, 0.285714, 0.375 , 0.444444])======================================================================FAIL: test_Assignment_True_Div_float_tensor_int_scalar (__main__.tensorAssignmentOperatorsTest)----------------------------------------------------------------------Traceback (most recent call last): File "tensorAssignmentOperators.py", line 624, in test_Assignment_True_Div_float_tensor_int_scalar np.testing.assert_array_equal(temp_np, np.array(temp_dc.data())) File "/home/gunjan/.local/lib/python3.6/site-packages/numpy/testing/_private/utils.py", line 913, in assert_array_equal verbose=verbose, header='Arrays are not equal') File "/home/gunjan/.local/lib/python3.6/site-packages/numpy/testing/_private/utils.py", line 836, in assert_array_compare raise AssertionError(msg)AssertionError: Arrays are not equalMismatch: 80%Max absolute difference: 2.38418579e-08Max relative difference: nan x: array([0. , 0.2, 0.4, 0.6, 0.8]) y: array([0. , 0.2, 0.4, 0.6, 0.8])----------------------------------------------------------------------Ran 4 tests in 0.052sFAILED (failures=3)
The text was updated successfully, but these errors were encountered:
test / swig / tensorAssignmentOperators.py (Line No. 619, 627, 651)
Here is the snippet of code
The tensor<float>/=tensor<bool> works, but tensor<float>/=tensor<int/float/double> doesn't. As output it shows:
The text was updated successfully, but these errors were encountered: