@@ -64,10 +64,10 @@ Tensor::Tensor(const Place &place) {
64
64
" the `place`, and datatype, shape, layout, etc. is also "
65
65
" required." ;
66
66
DefaultAllocator alloc (place);
67
- impl_ = std::move (std:: make_shared<phi::DenseTensor>(
67
+ impl_ = std::make_shared<phi::DenseTensor>(
68
68
&alloc,
69
- std::move ( phi::DenseTensorMeta (
70
- phi::DataType::FLOAT32, phi::make_ddim ({}), phi::DataLayout::NCHW)))) ;
69
+ phi::DenseTensorMeta (
70
+ phi::DataType::FLOAT32, phi::make_ddim ({}), phi::DataLayout::NCHW));
71
71
}
72
72
73
73
Tensor::Tensor (const Place &place, const std::vector<int64_t > &shape) {
@@ -80,11 +80,11 @@ Tensor::Tensor(const Place &place, const std::vector<int64_t> &shape) {
80
80
" the `place` and `shape`, and datatype, layout, etc. is also "
81
81
" required." ;
82
82
DefaultAllocator alloc (place);
83
- impl_ = std::move (std:: make_shared<phi::DenseTensor>(
83
+ impl_ = std::make_shared<phi::DenseTensor>(
84
84
&alloc,
85
- std::move ( phi::DenseTensorMeta (phi::DataType::FLOAT32,
86
- phi::make_ddim ({shape}),
87
- phi::DataLayout::NCHW)) ));
85
+ phi::DenseTensorMeta (phi::DataType::FLOAT32,
86
+ phi::make_ddim ({shape}),
87
+ phi::DataLayout::NCHW));
88
88
}
89
89
90
90
Tensor::Tensor (std::shared_ptr<phi::TensorBase> tensor_impl,
@@ -338,11 +338,11 @@ void *Tensor::data() {
338
338
// TODO(chenweihang): replace slice impl by API
339
339
Tensor Tensor::slice (int64_t begin_idx, int64_t end_idx) const {
340
340
if (is_dense_tensor ()) {
341
- return Tensor (std::make_shared<phi::DenseTensor>(
342
- std::move (phi::DenseTensorUtils::Slice (
341
+ return Tensor (
342
+ std::make_shared<phi::DenseTensor> (phi::DenseTensorUtils::Slice (
343
343
*(static_cast <phi::DenseTensor *>(impl_.get ())),
344
344
begin_idx,
345
- end_idx)))) ;
345
+ end_idx)));
346
346
} else {
347
347
PADDLE_THROW (phi::errors::Unimplemented (
348
348
" Only support slice operation on DenseTensor now." ));
0 commit comments