Reduce a redundant shallow copy of tensorflow::Tensor in TF_TensorFromTensor.

PiperOrigin-RevId: 325257291
Change-Id: Id0ae7304ea3a98901eb340445c12b237fe4672a6
This commit is contained in:
Ce Zheng 2020-08-06 10:22:30 -07:00 committed by TensorFlower Gardener
parent e4ddbcc740
commit a80ee49dd0

View File

@ -288,7 +288,7 @@ TF_Tensor* TF_TensorFromTensor(const tensorflow::Tensor& src, Status* status) {
if (!tensor.CopyFrom(src, src.shape())) {
return nullptr;
}
return new TF_Tensor{new tensorflow::TensorInterface(tensor)};
return new TF_Tensor{new tensorflow::TensorInterface(std::move(tensor))};
}
Status TF_TensorToTensor(const TF_Tensor* src, Tensor* dst) {