Browse Source

!754 remove redundant data copy

Merge pull request !754 from dinghao/fix_tensor
tags/v0.3.0-alpha
mindspore-ci-bot Gitee 5 years ago
parent
commit
b45c56d4dc
1 changed files with 0 additions and 3 deletions
  1. +0
    -3
      mindspore/ccsrc/ir/meta_tensor.cc

+ 0
- 3
mindspore/ccsrc/ir/meta_tensor.cc View File

@@ -166,9 +166,6 @@ Tensor::Tensor(const py::int_ &input, const TypePtr &data_type) { init(py::array
Tensor::Tensor(const Tensor &tensor, const TypePtr &data_type) Tensor::Tensor(const Tensor &tensor, const TypePtr &data_type)
: MetaTensor(tensor), dirty_(tensor.dirty_), device_address_(tensor.device_address_) { : MetaTensor(tensor), dirty_(tensor.dirty_), device_address_(tensor.device_address_) {
init(tensor.data_, data_type); init(tensor.data_, data_type);
if (device_address_ != nullptr) {
(void)data_sync();
}
} }


Tensor &Tensor::operator=(const Tensor &tensor) { Tensor &Tensor::operator=(const Tensor &tensor) {


Loading…
Cancel
Save