Reduce a redundant shallow copy of tensorflow::Tensor in TF_TensorFromTensor.
PiperOrigin-RevId: 325257291 Change-Id: Id0ae7304ea3a98901eb340445c12b237fe4672a6
This commit is contained in:
parent
e4ddbcc740
commit
a80ee49dd0
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user