Repository: pytorch
Issue: build caffe2 operators failed, 'sorry, unimplemented: non-trivial designated initializers not supported'
Labels: caffe2

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->
i want to build caffe2 server operators to test fbgemm, but i meet thest problems:

## To Reproduce

Steps to reproduce the behavior:

1.turn BUILD_CAFFE2_OPS and USE_FBGEMM on in CMakelists
2.cmake and make install 

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h: In instantiation of ‘caffe2::ConvOp<T, Context>::RunOnDeviceWithOrderNCHW()::<lambda(caffe2::Tensor*)> [with T = float; Context = caffe2::CPUContext]’:
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:173:13:   required from ‘struct caffe2::ConvOp<T, Context>::RunOnDeviceWithOrderNCHW() [with T = float; Context = caffe2::CPUContext]::<lambda(class caffe2::Tensor*)>’
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:181:3:   required from ‘bool caffe2::ConvOp<T, Context>::RunOnDeviceWithOrderNCHW() [with T = float; Context = caffe2::CPUContext]’
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op.cc:209:1:   required from here
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:118:15: error：redeclration of ‘const int& C’
             C * X_HxW,
               ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:98:53: note：‘const int& C’ previously declared here
         math::Im2Col<T, Context, StorageOrder::NCHW>(
                                                     ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:145:45: error：redeclration of ‘const int& G’ 
         math::GemmStridedBatched<T, Context>(
                                             ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:131:13: note：‘const int& G’ previously declared here
       if (G == 1) {
             ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:149:15: error：redeclration of ‘const int& M’ 
             M / G,
               ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:132:31: note：‘const int& M’ previously declared here
         math::Gemm<T, Context>(
                               ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:149:15: error：redeclration of ‘const int& G’ 
             M / G,
               ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:131:13: note：‘const int& G’ previously declared here
       if (G == 1) {
             ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:145:45: error：redeclration of ‘const int& Y_HxW’ 
         math::GemmStridedBatched<T, Context>(
                                             ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:132:31: note：‘const int& Y_HxW’ previously declared here
         math::Gemm<T, Context>(
                               ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:145:45: error：redeclration of ‘const int& kernel_dim’ 
         math::GemmStridedBatched<T, Context>(
                                             ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:132:31: note：‘const int& kernel_dim’ previously declared here
         math::Gemm<T, Context>(
                               ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:156:25: error：redeclration of ‘const int& buffer_size’ 
             buffer_size / G,
                         ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:116:55: note：‘const int& buffer_size’ previously declared here
         math::Im2ColNd<T, Context, StorageOrder::NCHW>(
                                                       ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:156:25: error：redeclration of ‘const int& G’ 
             buffer_size / G,
                         ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:131:13: note：‘const int& G’ previously declared here
       if (G == 1) {
             ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:159:22: error：redeclration of ‘const int& G’ 
             Y_stride / G,
                      ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:131:13: note：‘const int& G’ previously declared here
       if (G == 1) {
             ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:165:31: error：redeclration of ‘const int& M’ 
         math::Gemm<T, Context>(
                               ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:132:31: note：‘const int& M’ previously declared here
         math::Gemm<T, Context>(
                               ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:165:31: error：redeclration of ‘const int& Y_HxW’ 
         math::Gemm<T, Context>(
                               ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:132:31: note：‘const int& Y_HxW’ previously declared here
         math::Gemm<T, Context>(
                               ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:179:14: error：redeclration of ‘const int& Y_stride’ 
       Y_data += Y_stride;
              ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:159:22: note：‘const int& Y_stride’ previously declared here
             Y_stride / G,
                      ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h: In instantiation of ‘bool caffe2::ConvOp<T, Context>::RunOnDeviceWithOrderNCHW() [with T = float; Context = caffe2::CPUContext]’:
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op.cc:209:1:   required from here
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
   const auto func = [&](Tensor* col_buffer) {
                     ^
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported
## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

## Environment

Please copy and paste the output from our
[environment collection script](https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py)
(or fill out the checklist below manually).

You can get the script and run it with:
```
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
```

 - PyTorch Version (e.g., 1.0): 1.0
 - OS (e.g., Linux): Red Hat Linux
- GCC version: 5.1.0
 - How you installed PyTorch (`conda`, `pip`, source): source
 - Build command you used (if compiling from source):cmake .. && make install -j
 - Python version: 2.7
 - CUDA/cuDNN version: 9.1.85
 - GPU models and configuration:
GPU 0: Tesla K80
GPU 1: Tesla K80
GPU 2: Tesla K80
GPU 3: Tesla K80
 - Any other relevant information:

## Additional context
here is my CMakelists, thanks
<!-- Add any other context about the problem here. -->
[CMakeLists.txt](https://github.com/pytorch/pytorch/files/3221672/CMakeLists.txt)