/third_party/mindspore/tests/st/ops/gpu/ |
D | test_batchnorm_fold_op.py | 72 assert np.allclose(batch_mean.asnumpy(), expect1, rtol=1.e-7, atol=1.e-5) 73 assert np.allclose(batch_var.asnumpy(), expect2, rtol=1.e-7, atol=1.e-5) 74 assert np.allclose(ms_mean.asnumpy(), expect3, rtol=1.e-7, atol=1.e-5) 75 assert np.allclose(ms_var.asnumpy(), expect4, rtol=1.e-7, atol=1.e-5) 76 assert np.allclose(delay_mean.asnumpy(), expect5, rtol=1.e-7, atol=1.e-5) 77 assert np.allclose(delay_std.asnumpy(), expect6, rtol=1.e-7, atol=1.e-5) 96 assert np.allclose(batch_mean.asnumpy(), expect1, rtol=1.e-7, atol=1.e-5) 97 assert np.allclose(batch_var.asnumpy(), expect2, rtol=1.e-7, atol=1.e-5) 98 assert np.allclose(ms_mean.asnumpy(), expect3, rtol=1.e-7, atol=1.e-5) 99 assert np.allclose(delay_mean.asnumpy(), expect5, rtol=1.e-7, atol=1.e-5) [all …]
|
D | test_layer_norm_op.py | 91 assert np.allclose(y_ms.asnumpy(), y_np, rtol=1e-6, atol=1e-6) 92 assert np.allclose(mean_ms.asnumpy(), mean_np, rtol=1e-6, atol=1e-6) 93 assert np.allclose(var_ms.asnumpy(), var_np, rtol=1e-6, atol=1e-6) 114 assert np.allclose(y_ms.asnumpy(), y_np, rtol=1e-6, atol=1e-6) 115 assert np.allclose(mean_ms.asnumpy(), mean_np, rtol=1e-6, atol=1e-6) 116 assert np.allclose(var_ms.asnumpy(), var_np, rtol=1e-6, atol=1e-6) 137 assert np.allclose(y_ms.asnumpy(), y_np, rtol=1e-6, atol=1e-6) 138 assert np.allclose(mean_ms.asnumpy(), mean_np, rtol=1e-6, atol=1e-6) 139 assert np.allclose(var_ms.asnumpy(), var_np, rtol=1e-6, atol=1e-6) 159 assert np.allclose(y_ms.asnumpy(), y_np, rtol=1e-6, atol=1e-6) [all …]
|
D | test_layer_norm_grad_op.py | 87 assert np.allclose(dx_ms.asnumpy(), dx_np, rtol=1e-6, atol=1e-6) 88 assert np.allclose(dg_ms.asnumpy(), dg_np, rtol=1e-6, atol=1e-3) 89 assert np.allclose(db_ms.asnumpy(), db_np, rtol=1e-6, atol=1e-3) 114 assert np.allclose(dx_ms.asnumpy(), dx_np, rtol=1e-6, atol=1e-6) 115 assert np.allclose(dg_ms.asnumpy(), dg_np, rtol=1e-6, atol=1e-3) 116 assert np.allclose(db_ms.asnumpy(), db_np, rtol=1e-6, atol=1e-3) 141 assert np.allclose(dx_ms.asnumpy(), dx_np, rtol=1e-6, atol=1e-6) 142 assert np.allclose(dg_ms.asnumpy(), dg_np, rtol=1e-6, atol=1e-3) 143 assert np.allclose(db_ms.asnumpy(), db_np, rtol=1e-6, atol=1e-3) 167 assert np.allclose(dx_ms.asnumpy(), dx_np, rtol=1e-6, atol=1e-6) [all …]
|
D | test_layer_norm_grad_grad_op.py | 144 assert np.allclose(d_x_ms.asnumpy(), d_x_np, rtol=3e-3, atol=3e-3) 145 assert np.allclose(d_dy_ms.asnumpy(), d_dy_np, rtol=3e-3, atol=3e-3) 146 assert np.allclose(d_gamma_ms.asnumpy(), d_gamma_np, rtol=3e-3, atol=3e-3) 182 assert np.allclose(d_x_ms.asnumpy(), d_x_np, rtol=3e-3, atol=3e-3) 183 assert np.allclose(d_dy_ms.asnumpy(), d_dy_np, rtol=3e-3, atol=3e-3) 184 assert np.allclose(d_gamma_ms.asnumpy(), d_gamma_np, rtol=3e-3, atol=3e-3) 220 assert np.allclose(d_x_ms.asnumpy(), d_x_np, rtol=3e-3, atol=3e-3) 221 assert np.allclose(d_dy_ms.asnumpy(), d_dy_np, rtol=3e-3, atol=3e-3) 222 assert np.allclose(d_gamma_ms.asnumpy(), d_gamma_np, rtol=3e-3, atol=3e-3) 258 assert np.allclose(d_x_ms.asnumpy(), d_x_np, rtol=3e-3, atol=3e-3) [all …]
|
D | test_tensor_scatter_add.py | 55 np.testing.assert_allclose(out, expected, rtol=1e-6) 63 np.testing.assert_allclose(out, expected, rtol=1e-6) 71 np.testing.assert_allclose(out, expected, rtol=1e-6) 78 np.testing.assert_allclose(out, expected, rtol=1e-6) 85 np.testing.assert_allclose(out, expected, rtol=1e-6) 106 np.testing.assert_allclose(out, expected, rtol=1e-6) 126 np.testing.assert_allclose(out, expected, rtol=1e-6) 146 np.testing.assert_allclose(out, expected, rtol=1e-6)
|
D | test_tensor_scatter_update.py | 50 np.testing.assert_allclose(out, expected, rtol=1e-6) 64 np.testing.assert_allclose(out, expected, rtol=1e-6) 84 np.testing.assert_allclose(out, expected, rtol=1e-6) 104 np.testing.assert_allclose(out, expected, rtol=1e-6) 124 np.testing.assert_allclose(out, expected, rtol=1e-6)
|
D | test_tensor_scatter_min.py | 45 np.testing.assert_allclose(out, expected, rtol=1e-6) 54 np.testing.assert_allclose(out, expected, rtol=1e-6) 66 np.testing.assert_allclose(out, expected, rtol=1e-6) 75 np.testing.assert_allclose(out, expected, rtol=1e-6)
|
D | test_tensor_scatter_max.py | 45 np.testing.assert_allclose(out, expected, rtol=1e-6) 54 np.testing.assert_allclose(out, expected, rtol=1e-6) 66 np.testing.assert_allclose(out, expected, rtol=1e-6) 75 np.testing.assert_allclose(out, expected, rtol=1e-6)
|
/third_party/mindspore/tests/mindspore_test_framework/utils/ |
D | verifier_util.py | 21 def count_unequal_element(expect, result, rtol, atol): argument 37 count = np.count_nonzero(np.less_equal(error, atol + np.abs(result) * rtol)) 38 if ((total_count - count) / total_count) >= rtol: 47 def tolerance_assert(expect, result, rtol, atol): argument 59 if not np.allclose(expect, result, rtol, atol): 60 count_unequal_element(expect, result, rtol, atol)
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/opencl/ |
D | common.h | 44 void CompareOutput(void *output, void *expect, size_t elem_num, T atol, float rtol = 1e-9, bool pri… 58 auto tolerance = static_cast<float>(atol + rtol * std::fabs(expect_data[i])); 68 printf("Not equal to tolerance atol=%.0e, rtol=%.0e\n", atol, rtol); 76 void CompareOutput(Tensor *output_tensor, const std::string &file_path, float atol, float rtol = 1e… 79 CompareOutput<T>(output_tensor->data(), expect_data, output_tensor->ElementsNum(), atol, rtol); 97 … OpParameter *op_parameter, bool fp16_enable = false, float atol = 1e-9, float rtol = 1e-9, 101 … OpParameter *op_parameter, bool fp16_enable = false, float atol = 1e-9, float rtol = 1e-9, 105 … OpParameter *op_parameter, bool fp16_enable = false, float atol = 1e-9, float rtol = 1e-9, 109 … OpParameter *op_parameter, bool fp16_enable = false, float atol = 1e-9, float rtol = 1e-9, 112 … OpParameter *op_parameter, bool fp16_enable = false, float atol = 1e-9, float rtol = 1e-9,
|
/third_party/mindspore/tests/st/ops/cpu/ |
D | test_layer_norm_op.py | 89 assert np.allclose(y_ms.asnumpy(), y_np, rtol=1e-6, atol=1e-4) 90 assert np.allclose(mean_ms.asnumpy(), mean_np, rtol=1e-6, atol=1e-4) 91 assert np.allclose(var_ms.asnumpy(), var_np, rtol=1e-6, atol=1e-4) 111 assert np.allclose(y_ms.asnumpy(), y_np, rtol=1e-6, atol=1e-4) 112 assert np.allclose(mean_ms.asnumpy(), mean_np, rtol=1e-6, atol=1e-4) 113 assert np.allclose(var_ms.asnumpy(), var_np, rtol=1e-6, atol=1e-4) 133 assert np.allclose(y_ms.asnumpy(), y_np, rtol=1e-6, atol=1e-4) 134 assert np.allclose(mean_ms.asnumpy(), mean_np, rtol=1e-6, atol=1e-4) 135 assert np.allclose(var_ms.asnumpy(), var_np, rtol=1e-6, atol=1e-4) 154 assert np.allclose(y_ms.asnumpy(), y_np, rtol=1e-6, atol=1e-4) [all …]
|
D | test_layer_norm_grad_op.py | 87 assert np.allclose(dx_ms.asnumpy(), dx_np, rtol=1e-4, atol=1e-4) 88 assert np.allclose(dg_ms.asnumpy(), dg_np, rtol=1e-4, atol=1e-3) 89 assert np.allclose(db_ms.asnumpy(), db_np, rtol=1e-4, atol=1e-3) 114 assert np.allclose(dx_ms.asnumpy(), dx_np, rtol=1e-4, atol=1e-4) 115 assert np.allclose(dg_ms.asnumpy(), dg_np, rtol=1e-4, atol=1e-3) 116 assert np.allclose(db_ms.asnumpy(), db_np, rtol=1e-4, atol=1e-3) 141 assert np.allclose(dx_ms.asnumpy(), dx_np, rtol=1e-4, atol=1e-4) 142 assert np.allclose(dg_ms.asnumpy(), dg_np, rtol=1e-4, atol=1e-3) 143 assert np.allclose(db_ms.asnumpy(), db_np, rtol=1e-4, atol=1e-3) 167 assert np.allclose(dx_ms.asnumpy(), dx_np, rtol=1e-4, atol=1e-4) [all …]
|
D | test_squeeze_op.py | 43 assert np.allclose(result.asnumpy(), expect, rtol=1.e-4, 55 assert np.allclose(result.asnumpy(), expect, rtol=1.e-4, 67 assert np.allclose(result.asnumpy(), expect, rtol=1.e-4, 80 assert np.allclose(result.asnumpy(), expect, rtol=1.e-4, 93 assert np.allclose(result.asnumpy(), expect, rtol=1.e-4,
|
D | test_maximum_grad.py | 47 assert np.allclose(result[0].asnumpy(), dx, rtol=1.e-4, atol=1.e-8, equal_nan=True) 48 assert np.allclose(result[1].asnumpy(), dy, rtol=1.e-4, atol=1.e-8, equal_nan=True) 169 assert np.allclose(result[0].asnumpy(), dx, rtol=1.e-4, atol=1.e-8, equal_nan=True) 170 assert np.allclose(result[1].asnumpy(), dy, rtol=1.e-4, atol=1.e-8, equal_nan=True)
|
/third_party/mindspore/tests/ut/python/dataset/ |
D | test_time_stretch.py | 37 def count_unequal_element(data_expected, data_me, rtol, atol): argument 41 greater = np.greater(error, atol + np.abs(data_expected) * rtol) 43 …assert (loss_count / total_count) < rtol, "\ndata_expected_std:{0}\ndata_me_error:{1}\nloss:{2}".f… 47 def allclose_nparray(data_expected, data_me, rtol, atol, equal_nan=True): argument 49 assert np.allclose(data_me, data_expected, rtol, atol, equal_nan=equal_nan) 50 elif not np.allclose(data_me, data_expected, rtol, atol, equal_nan=equal_nan): 51 count_unequal_element(data_expected, data_me, rtol, atol)
|
D | test_amplitude_to_db.py | 37 def count_unequal_element(data_expected, data_me, rtol, atol): argument 42 greater = np.greater(error, atol + np.abs(data_expected) * rtol) 44 …assert (loss_count / total_count) < rtol, "\ndata_expected_std:{0}\ndata_me_error:{1}\nloss:{2}".f… 48 def allclose_nparray(data_expected, data_me, rtol, atol, equal_nan=True): argument 51 assert np.allclose(data_me, data_expected, rtol, atol, equal_nan=equal_nan) 52 elif not np.allclose(data_me, data_expected, rtol, atol, equal_nan=equal_nan): 53 count_unequal_element(data_expected, data_me, rtol, atol)
|
D | test_frequency_masking.py | 37 def count_unequal_element(data_expected, data_me, rtol, atol): argument 42 greater = np.greater(error, atol + np.abs(data_expected) * rtol) 44 …assert (loss_count / total_count) < rtol, "\ndata_expected_std:{0}\ndata_me_error:{1}\nloss:{2}".f… 48 def allclose_nparray(data_expected, data_me, rtol, atol, equal_nan=True): argument 51 assert np.allclose(data_me, data_expected, rtol, atol, equal_nan=equal_nan) 52 elif not np.allclose(data_me, data_expected, rtol, atol, equal_nan=equal_nan): 53 count_unequal_element(data_expected, data_me, rtol, atol)
|
D | test_time_masking.py | 37 def count_unequal_element(data_expected, data_me, rtol, atol): argument 42 greater = np.greater(error, atol + np.abs(data_expected) * rtol) 44 …assert (loss_count / total_count) < rtol, "\ndata_expected_std:{0}\ndata_me_error:{1}\nloss:{2}".f… 48 def allclose_nparray(data_expected, data_me, rtol, atol, equal_nan=True): argument 51 assert np.allclose(data_me, data_expected, rtol, atol, equal_nan=equal_nan) 52 elif not np.allclose(data_me, data_expected, rtol, atol, equal_nan=equal_nan): 53 count_unequal_element(data_expected, data_me, rtol, atol)
|
D | test_vol.py | 27 def count_unequal_element(data_expected, data_me, rtol, atol): argument 32 greater = np.greater(error, atol + np.abs(data_expected) * rtol) 34 assert (loss_count / total_count) < rtol, \ 39 def allclose_nparray(data_expected, data_me, rtol, atol, equal_nan=True): argument 42 assert np.allclose(data_me, data_expected, rtol, atol, equal_nan=equal_nan) 43 elif not np.allclose(data_me, data_expected, rtol, atol, equal_nan=equal_nan): 44 count_unequal_element(data_expected, data_me, rtol, atol)
|
D | test_rgb_hsv.py | 50 assert_allclose(hsv_base.flatten(), hsv_de.flatten(), rtol=1e-5, atol=0) 61 assert_allclose(rgb_base.flatten(), rgb_de.flatten(), rtol=1e-5, atol=0) 75 assert_allclose(hsv_base.flatten(), hsv_de.flatten(), rtol=1e-5, atol=0) 86 assert_allclose(rgb_base.flatten(), rgb_de.flatten(), rtol=1e-5, atol=0) 99 assert_allclose(hsv_base.flatten(), hsv_de.flatten(), rtol=1e-5, atol=0) 109 assert_allclose(rgb_base.flatten(), rgb_de.flatten(), rtol=1e-5, atol=0) 122 assert_allclose(hsv_base_imgs.flatten(), hsv_de.flatten(), rtol=1e-5, atol=0) 131 assert_allclose(rgb_base.flatten(), rgb_de.flatten(), rtol=1e-5, atol=0) 162 assert_allclose(ori_img.flatten(), cvt_img.flatten(), rtol=1e-5, atol=0)
|
D | test_rgb_bgr.py | 49 rtol=1e-5, 65 rtol=1e-5, 78 rtol=1e-5, 117 rtol=1e-5, 159 rtol=1e-5,
|
/third_party/mindspore/tests/st/mix_precision/ |
D | utils.py | 26 def _count_unequal_element(data_expected, data_me, rtol, atol): argument 30 greater = np.greater(error, atol + np.abs(data_me) * rtol) 32 assert (loss_count / total_count) < rtol, \ 37 def allclose_nparray(data_expected, data_me, rtol, atol, equal_nan=True): argument 39 assert np.allclose(data_expected, data_me, rtol, atol, equal_nan=equal_nan) 40 elif not np.allclose(data_expected, data_me, rtol, atol, equal_nan=equal_nan): 41 _count_unequal_element(data_expected, data_me, rtol, atol)
|
/third_party/mindspore/tests/st/auto_monad/ |
D | test_auto_monad_expression.py | 40 def _count_unequal_element(data_expected, data_me, rtol, atol): argument 44 greater = np.greater(error, atol + np.abs(data_me) * rtol) 46 assert (loss_count / total_count) < rtol, \ 51 def allclose_nparray(data_expected, data_me, rtol, atol, equal_nan=True): argument 53 assert np.allclose(data_expected, data_me, rtol, atol, equal_nan=equal_nan) 54 elif not np.allclose(data_expected, data_me, rtol, atol, equal_nan=equal_nan): 55 _count_unequal_element(data_expected, data_me, rtol, atol)
|
/third_party/mindspore/tests/st/pynative/ |
D | test_pynative_mixed_precision_cells.py | 70 def _count_unequal_element(data_expected, data_me, rtol, atol): argument 74 greater = np.greater(error, atol + np.abs(data_me)*rtol) 76 assert (loss_count/total_count) < rtol, \ 80 def allclose_nparray(data_expected, data_me, rtol, atol, equal_nan=True): argument 82 assert np.allclose(data_expected, data_me, rtol, atol, equal_nan=equal_nan) 83 elif not np.allclose(data_expected, data_me, rtol, atol, equal_nan=equal_nan): 84 _count_unequal_element(data_expected, data_me, rtol, atol)
|
/third_party/mindspore/tests/st/ops/graph_kernel/ |
D | test_bias_add_grad.py | 46 rtol = 1.e-4 49 rtol = 1.e-3 51 assert np.allclose(expect.asnumpy(), output.asnumpy(), rtol, atol, equal_nan=True)
|