Remove Context dependency from Tensor class (#14269)
authorDmytro Dzhulgakov <dzhulgakov@fb.com>
Wed, 28 Nov 2018 23:43:22 +0000 (15:43 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 28 Nov 2018 23:45:38 +0000 (15:45 -0800)
commitda9e49e586016d8905c242f9df1f4aeff2a96853
treeaf2cf7ab2cd750f4aa344426284959a00e1299f3
parent0cfbbceac32613db618f6abac8c0b8b3cca3fac1
Remove Context dependency from Tensor class (#14269)

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

Removes reference to Context proper and instead adds a bool argument for async copy (the same as `copy_`)

For CopyFrom - I haven't tweaked all callsites yet. Instead I rely on a terrible hack that pointer to context is implicitly converted to bool when passed, haha :) It's not a good code and I propose to fix it in a follow up diff (maybe using clangr tooling).

Reviewed By: ezyang

Differential Revision: D13117981

fbshipit-source-id: 7cb1dc2ba6a4c50ac26614f45ab8318ea96e3138
22 files changed:
aten/src/ATen/core/TensorImpl.h
caffe2/core/tensor.cc
caffe2/core/tensor.h
caffe2/experiments/operators/tt_pad_op.h
caffe2/mobile/contrib/ios/mpscnn/mpscnn.mm
caffe2/operators/box_with_nms_limit_op.cc
caffe2/operators/dataset_ops.cc
caffe2/operators/expand_squeeze_dims_op.h
caffe2/operators/generate_proposals_op.cc
caffe2/operators/last_n_window_collector.cc
caffe2/operators/mean_op.h
caffe2/operators/onnx_while_op.h
caffe2/operators/reservoir_sampling.cc
caffe2/operators/rmac_regions_op.cc
caffe2/operators/sequence_ops.h
caffe2/operators/slice_op.cu
caffe2/operators/slice_op.h
caffe2/operators/stop_gradient.h
caffe2/operators/utility_ops.cu
caffe2/operators/utility_ops.h
caffe2/queue/queue_ops.h
caffe2/video/video_input_op.h