Set test case name for ReshapeMatMul tests (#16705)

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
This commit is contained in:
Ilya Churaev 2023-04-06 15:40:20 +04:00 committed by GitHub
parent dbe051aa79
commit cafc7359c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,6 +34,35 @@ struct ReshapeMatMulTestCase {
class SmartReshapeMatMulTests : public CommonTestUtils::TestsCommon,
public testing::WithParamInterface<std::tuple<ReshapeMatMulTestCase>> {
public:
static std::string getTestCaseName(testing::TestParamInfo<std::tuple<ReshapeMatMulTestCase>> obj) {
std::ostringstream result;
const auto& value = std::get<0>(obj.param);
result << "reshape_is_A_input=" << value.reshape_is_A_input << "_";
result << "A_shape=" << value.A_shape << "_";
result << "B_shape=" << value.B_shape << "_";
result << "reshape_pattern=[";
for (size_t i = 0; i < value.reshape_pattern.size(); i++) {
if (i)
result << ",";
result << value.reshape_pattern[i];
}
result << "]_";
result << "transpose_a=" << value.transpose_a << "_";
result << "transpose_b=" << value.transpose_b << "_";
result << "new_shapes={";
for (const auto& it : value.new_shapes) {
result << it.first << "=[";
for (size_t i = 0; i < it.second.size(); i++) {
if (i)
result << ",";
result << it.second[i];
}
result << "]";
}
result << "}";
return result.str();
}
void SetUp() override {
const auto& test_case = std::get<0>(GetParam());
@ -86,7 +115,8 @@ INSTANTIATE_TEST_SUITE_P(
ReshapeMatMulTestCase{false, {20, 30}, {1, 30, 40}, {-1, 40}, false, false, {{"input_B", {2, 30, 40}}}},
ReshapeMatMulTestCase{false, {20, 30}, {1, 40, 30}, {40, -1}, false, true, {{"input_B", {2, 40, 30}}}},
ReshapeMatMulTestCase{false, {30, 20}, {1, 30, 40}, {-1, 40}, true, false, {{"input_B", {2, 30, 40}}}},
ReshapeMatMulTestCase{false, {30, 20}, {1, 40, 30}, {40, -1}, true, true, {{"input_B", {2, 40, 30}}}}));
ReshapeMatMulTestCase{false, {30, 20}, {1, 40, 30}, {40, -1}, true, true, {{"input_B", {2, 40, 30}}}}),
SmartReshapeMatMulTests::getTestCaseName);
} // namespace
TEST(SmartReshapeTransposeMatMulTests, TransposeAMatMulFuse) {