| 32 | |
| 33 | template <typename T> |
| 34 | bool CreateCaseSymmetric() { |
| 35 | const T tensorData[] = {1, 2, 3, 4, 5, 6}; |
| 36 | const int padData[] = {1, 1, 2, 2}; |
| 37 | |
| 38 | const T expectedData[] = {2, 1, 1, 2, 3, 3, 2, 2, 1, 1, 2, 3, 3, 2, 5, 4, 4, 5, 6, 6, 5, 5, 4, 4, 5, 6, 6, 5}; |
| 39 | |
| 40 | auto tensor = _Const(tensorData, {2, 3}, NHWC, halide_type_of<T>()); |
| 41 | auto pad = _Const(padData, {4}, NHWC, halide_type_of<int>()); |
| 42 | auto result = _Pad(tensor, pad, SYMMETRIC); |
| 43 | |
| 44 | const auto resultData = result->template readMap<T>(); |
| 45 | const int size = result->getInfo()->size; |
| 46 | if (!checkVector<T>(resultData, expectedData, size, 0)) { |
| 47 | return false; |
| 48 | } |
| 49 | |
| 50 | return true; |
| 51 | } |
| 52 | |
| 53 | template <typename T> |
| 54 | bool CreateCaseReflect() { |