| 144 | constexpr FilterDimMap DimMaps::kFdmOIHW[4]; |
| 145 | |
| 146 | TEST(TensorFormatTest, FormatEnumsAndStrings) { |
| 147 | const string prefix = "FORMAT_"; |
| 148 | for (auto& test_data_format : test_data_formats) { |
| 149 | const char* stringified_format_enum = test_data_format.second; |
| 150 | LOG(INFO) << stringified_format_enum << " = " << test_data_format.first; |
| 151 | string expected_format_str = &stringified_format_enum[prefix.size()]; |
| 152 | TensorFormat format; |
| 153 | EXPECT_TRUE(FormatFromString(expected_format_str, &format)); |
| 154 | string format_str = ToString(format); |
| 155 | EXPECT_EQ(expected_format_str, format_str); |
| 156 | EXPECT_EQ(test_data_format.first, format); |
| 157 | } |
| 158 | for (auto& test_filter_format : test_filter_formats) { |
| 159 | const char* stringified_format_enum = test_filter_format.second; |
| 160 | LOG(INFO) << stringified_format_enum << " = " << test_filter_format.first; |
| 161 | string expected_format_str = &stringified_format_enum[prefix.size()]; |
| 162 | FilterTensorFormat format; |
| 163 | EXPECT_TRUE(FilterFormatFromString(expected_format_str, &format)); |
| 164 | string format_str = ToString(format); |
| 165 | EXPECT_EQ(expected_format_str, format_str); |
| 166 | EXPECT_EQ(test_filter_format.first, format); |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | template <int num_spatial_dims> |
| 171 | void RunDimensionIndexesTest() { |
nothing calls this directly
no test coverage detected