Tensor construction codemod(raw_mutable_data) (#16373)
authorJerry Zhang <jerryzh@fb.com>
Sat, 30 Mar 2019 01:26:07 +0000 (18:26 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 30 Mar 2019 01:36:46 +0000 (18:36 -0700)
commitd73c830e236f5b980e5c91914b818d150b60278c
treefa30e251b2bfa661485af8f081f0b441db562d80
parent7b0ef317806178b5c3e4135ef53b78f60f767991
Tensor construction codemod(raw_mutable_data) (#16373)

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

motivation: https://github.com/pytorch/pytorch/pull/12407
This is a manual diff.
most of the fixes should be:

```
auto* Y = Output(0);
Y->Resize(dims);
Y->raw_mutable_data(dtype);
```
-->
```
auto* Y = Output(0, dims, at::dtype(dtype));
```
But there might be other cases.

Reviewed By: dzhulgakov

Differential Revision: D13725460

fbshipit-source-id: 649a4b0e42f62cda1a60171dd9fa3e440dc9dca1
27 files changed:
caffe2/operators/boolean_mask_ops.cc
caffe2/operators/boolean_mask_ops.cu
caffe2/operators/boolean_unmask_ops.cc
caffe2/operators/boolean_unmask_ops.cu
caffe2/operators/concat_split_op.h
caffe2/operators/conditional_op.cc
caffe2/operators/copy_op.cu
caffe2/operators/copy_op.h
caffe2/operators/crf_viterbi_op.cc
caffe2/operators/dataset_ops.cc
caffe2/operators/ensure_cpu_output_op.h
caffe2/operators/flatten_op.h
caffe2/operators/gather_ranges_to_dense_op.h
caffe2/operators/lengths_tile_op.cc
caffe2/operators/pack_segments.cc
caffe2/operators/pack_segments.cu
caffe2/operators/partition_ops.h
caffe2/operators/prepend_dim_op.h
caffe2/operators/remove_data_blocks_op.h
caffe2/operators/reservoir_sampling.cc
caffe2/operators/reshape_op.h
caffe2/operators/sequence_ops.cc
caffe2/operators/text_file_reader.cc
caffe2/operators/tile_op.h
caffe2/operators/utility_ops.h
caffe2/quantization/server/fully_connected_dnnlowp_op.cc
caffe2/queue/rebatching_queue.cc