[ROCm] Fix for a test regression on the ROCm platform

The following commit introduces a test regression on the ROCm platform
a2aa5e3f04

After the commit, the test fails to build with the following error.

```
ERROR: /root/tensorflow/tensorflow/lite/kernels/BUILD:846:1: Couldn't build file tensorflow/lite/kernels/_objs/concatenation_test/concatenation_test.o: C++ compilation of rule '//tensorflow/lite/kernels:concatenation_test' failed (Exit 1)
tensorflow/lite/kernels/concatenation_test.cc:276:26: error: expected ';' at end of member declaration
       std::is_same<Type, int16_t>::value ? TensorType_INT16 : TensorType_INT8;
                          ^
tensorflow/lite/kernels/concatenation_test.cc:276:33: error: expected unqualified-id before '>' token
       std::is_same<Type, int16_t>::value ? TensorType_INT16 : TensorType_INT8;
                                 ^
tensorflow/lite/kernels/concatenation_test.cc:276:20: error: wrong number of template arguments (1, should be 2)
       std::is_same<Type, int16_t>::value ? TensorType_INT16 : TensorType_INT8;
                    ^
In file included from /usr/include/c++/5/bits/move.h:57:0,
                 from /usr/include/c++/5/bits/stl_pair.h:59,
                 from /usr/include/c++/5/bits/stl_algobase.h:64,
                 from /usr/include/c++/5/memory:62,
                 from external/com_google_googletest/googletest/include/gtest/gtest.h:56,
                 from tensorflow/lite/kernels/concatenation_test.cc:17:
/usr/include/c++/5/type_traits:958:12: note: provided for 'template<class, class> struct std::is_same'
     struct is_same;
            ^
```

The fix is to put parens around the RHS expr, to fox what seems to be a parsing error. Don't think this error was ROCm specific.
This commit is contained in:
Deven Desai 2020-02-07 20:26:52 +00:00
parent 75e2a0a14f
commit 6e77109e62

View File

@ -273,7 +273,7 @@ struct ConcatenationOpTestTyped : public testing::Test {
using TestType = Type;
enum TensorType tensor_type =
std::is_same<Type, int16_t>::value ? TensorType_INT16 : TensorType_INT8;
(std::is_same<Type, int16_t>::value ? TensorType_INT16 : TensorType_INT8);
};
using TestTypes = testing::Types<int8_t, int16_t>;