pytorch
5b6f6da1 - [caffe2] Copy tensor in single tensor input case in UnPackRecordsOp (#37454)

Commit
5 years ago
[caffe2] Copy tensor in single tensor input case in UnPackRecordsOp (#37454) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/37454 Fix a bug introduced in D21224497. In the case of having a single unpacked tensor as input, we still need to copy the underline memory because only inputs are guaranteed to be read-only. The output could be overwritten later during inference. If we share the tensor, we could potentially overwrite the input, which in principle should be read only. Test Plan: ``` buck test caffe2/caffe2/python/operator_test:dataset_ops_test ``` AdIndexer canary: https://our.intern.facebook.com/intern/ads/canary/426290361213982683 Reviewed By: yinghai Differential Revision: D21274309 fbshipit-source-id: 71931d4b1afbdc700ba070ea618d1679f1bbe5a7
Author
Hao Lu
Parents
Loading