Syntax cleanup.

MSVC does not like casting of initializer lists:
error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax

PiperOrigin-RevId: 290091791
Change-Id: I5e2cfb5e78da21074bddd80ba0cfa779697b667b
This commit is contained in:
Gunhan Gulsoy 2020-01-16 10:16:48 -08:00 committed by TensorFlower Gardener
parent 0fd0b29082
commit 925df1d0c8

View File

@ -413,7 +413,8 @@ TEST_F(TensorReshapeTest, Reshape) {
#define TEST_RESHAPE(...) \
{ \
constexpr int N = (sizeof((int[]){__VA_ARGS__}) / sizeof(int)); \
int _tmp[] = {__VA_ARGS__}; \
constexpr int N = (sizeof(_tmp) / sizeof(int)); \
TestReshape<TTypes<float, N>::Tensor, &Tensor::shaped<float, N>>( \
{__VA_ARGS__}); \
TestReshape<TTypes<float, N>::ConstTensor, &Tensor::shaped<float, N>>( \
@ -442,7 +443,8 @@ TEST_F(TensorReshapeTest, Reshape) {
TEST_F(TensorReshapeTest, BitcastReshapeDifferentSize) {
#define TEST_BITCAST8_RESHAPE(...) \
{ \
constexpr int N = (sizeof((int[]){__VA_ARGS__}) / sizeof(int)); \
int _tmp[] = {__VA_ARGS__}; \
constexpr int N = (sizeof(_tmp) / sizeof(int)); \
TestReshape<TTypes<uint8, N>::Tensor, \
&Tensor::bit_casted_shaped<uint8, N>>({__VA_ARGS__}); \
}
@ -454,7 +456,8 @@ TEST_F(TensorReshapeTest, BitcastReshapeDifferentSize) {
#undef TEST_BITCAST8_RESHAPE
#define TEST_BITCAST16_RESHAPE(...) \
{ \
constexpr int N = (sizeof((int[]){__VA_ARGS__}) / sizeof(int)); \
int _tmp[] = {__VA_ARGS__}; \
constexpr int N = (sizeof(_tmp) / sizeof(int)); \
TestReshape<TTypes<int16, N>::Tensor, \
&Tensor::bit_casted_shaped<int16, N>>({__VA_ARGS__}); \
}