Change ConvPoolOp<Context>::SetOutputSize to ConvPoolOp<Context>::GetOutputSize ...
authorJerry Zhang <jerryzh@fb.com>
Mon, 28 Jan 2019 23:51:25 +0000 (15:51 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 28 Jan 2019 23:56:34 +0000 (15:56 -0800)
commitff963d4b9fe074fa22e4b024c14b737851d80eac
treed0058a209c757d412d7b3a03325fd61104224bb0
parentb076227b21c8134e210844fcc63d8eee3e1273e7
Change ConvPoolOp<Context>::SetOutputSize to ConvPoolOp<Context>::GetOutputSize (#16273)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16273

Previously we have SetOutputSize which accept a partially initialized Output Tensor and set it to the correct size,
the diff change this to GetOutputSize that returns the correct size instead.
e.g.
```
auto* Y = Output(0);
ConvPoolOp<Context>::SetOutputSize(X, Y, channels);
...
Y->mutable_data<T>...
```
-->
```
auto sizes = ConvPoolOp<Context>::GetOutputSize(X, channels);
auto* Y = Output(0, sizes, at::dtype<T>());
```

Reviewed By: dzhulgakov

Differential Revision: D13736281

fbshipit-source-id: 64abce3dbaed0b375098463333dfd0ea5a3b1945
29 files changed:
caffe2/contrib/nnpack/nnpack_ops.cc
caffe2/cuda_rtc/pool_op_rtc_gpu.cc
caffe2/mobile/contrib/ios/mpscnn/mpscnn.mm
caffe2/operators/conv_op_cudnn.cc
caffe2/operators/conv_op_eigen.cc
caffe2/operators/conv_op_impl.h
caffe2/operators/conv_pool_op_base.h
caffe2/operators/deform_conv_op_impl.h
caffe2/operators/depthwise_3x3_conv_op_cudnn.cu
caffe2/operators/hip/conv_op_miopen.hip
caffe2/operators/hip/pool_op_miopen.hip
caffe2/operators/locally_connected_op_impl.h
caffe2/operators/lp_pool_op.cc
caffe2/operators/lp_pool_op.cu
caffe2/operators/max_pool_with_index.cu
caffe2/operators/pad_op.cc
caffe2/operators/pad_op_gpu.cu
caffe2/operators/pool_op.h
caffe2/operators/pool_op_cudnn.cc
caffe2/operators/quantized/int8_average_pool_op.h
caffe2/operators/quantized/int8_conv_op.h
caffe2/operators/quantized/int8_max_pool_op.h
caffe2/quantization/server/conv_dnnlowp_acc16_op.cc
caffe2/quantization/server/conv_dnnlowp_op.cc
caffe2/quantization/server/conv_pool_dnnlowp_op_base.h
caffe2/quantization/server/dnnlowp_op.h
caffe2/quantization/server/pool_dnnlowp_op.cc
caffe2/share/contrib/depthwise/depthwise3x3_conv_op.cc
caffe2/share/contrib/nnpack/conv_op.cc