MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/core/util/tensor_format_test.cc:146–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144constexpr FilterDimMap DimMaps::kFdmOIHW[4];
145
146TEST(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
170template <int num_spatial_dims>
171void RunDimensionIndexesTest() {

Callers

nothing calls this directly

Calls 4

FormatFromStringFunction · 0.85
FilterFormatFromStringFunction · 0.85
ToStringFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected