Commit 7064962b authored by charlie's avatar charlie
Browse files

Tidy fix and api test fix

parent ba40f978
......@@ -66,7 +66,7 @@ TEST_CASE(load_and_run_init_list)
TEST_CASE(quantize_fp16)
{
auto p1 = migraphx::parse_onnx("gemm_ex_test.onnx");
auto p1 = migraphx::parse_onnx("gemm_test.onnx");
const auto& p2 = p1;
const auto& p3 = p1;
migraphx::quantize_fp16(p1);
......@@ -82,7 +82,7 @@ TEST_CASE(quantize_fp16)
TEST_CASE(quantize_int8)
{
auto p1 = migraphx::parse_onnx("gemm_ex_test.onnx");
auto p1 = migraphx::parse_onnx("gemm_test.onnx");
const auto& p2 = p1;
auto t = migraphx::target("ref");
migraphx::quantize_int8_options options;
......
......@@ -456,30 +456,30 @@ TEST_CASE(gemm_test)
migraphx::program p = migraphx::parse_onnx("gemm_brcst_C_test.onnx");
p.compile(migraphx::ref::target{});
migraphx::shape A_shape{migraphx::shape::float_type, {5, 6}};
std::vector<float> A_data = {0.26472837, 0.8525864, 0.41929847, 0.14151508, 0.43216065,
migraphx::shape a_shape{migraphx::shape::float_type, {5, 6}};
std::vector<float> a_data = {0.26472837, 0.8525864, 0.41929847, 0.14151508, 0.43216065,
0.67468566, 0.42488748, 0.82021785, 0.9782456, 0.5794279,
0.6627283, 0.4790396, 0.9237051, 0.7340607, 0.67379653,
0.87168175, 0.37324256, 0.33278653, 0.42736676, 0.024699844,
0.75851107, 0.48719302, 0.5834426, 0.6938476, 0.43747696,
0.24054702, 0.26912406, 0.6760658, 0.5419149, 0.89949054};
migraphx::shape B_shape{migraphx::shape::float_type, {5, 7}};
std::vector<float> B_data = {
migraphx::shape b_shape{migraphx::shape::float_type, {5, 7}};
std::vector<float> b_data = {
0.65727437, 0.54262096, 0.14126152, 0.8994123, 0.21831702, 0.81191784, 0.9371278,
0.3438551, 0.7121373, 0.90316695, 0.26614252, 0.80144906, 0.80301756, 0.49930334,
0.0719704, 0.63484156, 0.7343097, 0.32130218, 0.7094916, 0.6116475, 0.74144083,
0.021210382, 0.38724765, 0.44830495, 0.62347615, 0.022489505, 0.23316588, 0.76540905,
0.895689, 0.81540287, 0.223875, 0.9275573, 0.4621397, 0.70785195, 0.5658555};
migraphx::shape C_shape{migraphx::shape::float_type, {6, 1}};
std::vector<float> C_data = {
migraphx::shape c_shape{migraphx::shape::float_type, {6, 1}};
std::vector<float> c_data = {
0.07358502, 0.13792239, 0.8574055, 0.40553397, 0.38205826, 0.62062204};
migraphx::parameter_map params;
params["A"] = migraphx::argument(A_shape, A_data.data());
params["B"] = migraphx::argument(B_shape, B_data.data());
params["C"] = migraphx::argument(C_shape, C_data.data());
params["A"] = migraphx::argument(a_shape, a_data.data());
params["B"] = migraphx::argument(b_shape, b_data.data());
params["C"] = migraphx::argument(c_shape, c_data.data());
auto result = p.eval(params).back();
std::vector<float> result_vector;
......@@ -500,32 +500,32 @@ TEST_CASE(gemm_half_test)
migraphx::program p = migraphx::parse_onnx("gemm_half_test.onnx");
p.compile(migraphx::ref::target{});
migraphx::shape A_shape{migraphx::shape::half_type, {8, 6}};
migraphx::shape a_shape{migraphx::shape::half_type, {8, 6}};
std::vector tmp = {0.2646, 0.8525, 0.4192, 0.1415, 0.4321, 0.675, 0.4248, 0.8203,
0.978, 0.5796, 0.6626, 0.479, 0.924, 0.734, 0.674, 0.8716,
0.3733, 0.3328, 0.4272, 0.0247, 0.7583, 0.4873, 0.5835, 0.694,
0.4375, 0.2406, 0.269, 0.6763, 0.542, 0.8994, 0.657, 0.5425,
0.1412, 0.8994, 0.2183, 0.812, 0.937, 0.3438, 0.712, 0.9033,
0.266, 0.8013, 0.803, 0.4993, 0.07196, 0.635, 0.7344, 0.3213};
std::vector<migraphx::half> A_data{tmp.cbegin(), tmp.cend()};
std::vector<migraphx::half> a_data{tmp.cbegin(), tmp.cend()};
migraphx::shape B_shape{migraphx::shape::half_type, {8, 7}};
migraphx::shape b_shape{migraphx::shape::half_type, {8, 7}};
tmp = {0.7095, 0.612, 0.741, 0.02121, 0.3872, 0.4482, 0.6235, 0.02249, 0.2332, 0.7656,
0.8955, 0.8154, 0.2239, 0.9277, 0.4622, 0.708, 0.566, 0.0736, 0.138, 0.8574,
0.4055, 0.382, 0.6206, 0.424, 0.3674, 0.435, 0.998, 0.3594, 0.701, 0.6216,
0.01826, 0.6313, 0.514, 0.1095, 0.3203, 0.01636, 0.537, 0.01952, 0.4502, 0.8965,
0.5415, 0.7456, 0.793, 0.756, 0.9, 0.5264, 0.05368, 0.4214, 0.276, 0.1517,
0.08453, 0.83, 0.417, 0.1682, 0.845, 0.1729};
std::vector<migraphx::half> B_data{tmp.cbegin(), tmp.cend()};
std::vector<migraphx::half> b_data{tmp.cbegin(), tmp.cend()};
migraphx::shape C_shape{migraphx::shape::half_type, {6, 1}};
migraphx::shape c_shape{migraphx::shape::half_type, {6, 1}};
tmp = {0.10846, 0.672, 0.527, 0.94, 0.429, 0.2291};
std::vector<migraphx::half> C_data{tmp.cbegin(), tmp.cend()};
std::vector<migraphx::half> c_data{tmp.cbegin(), tmp.cend()};
migraphx::parameter_map params;
params["A"] = migraphx::argument(A_shape, A_data.data());
params["B"] = migraphx::argument(B_shape, B_data.data());
params["C"] = migraphx::argument(C_shape, C_data.data());
params["A"] = migraphx::argument(a_shape, a_data.data());
params["B"] = migraphx::argument(b_shape, b_data.data());
params["C"] = migraphx::argument(c_shape, c_data.data());
auto result = p.eval(params).back();
std::vector<migraphx::half> result_vector;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment