There was an error while loading. Please reload this page.
const
Tensor.contiguous
1 parent 77903fa commit 70bf749Copy full SHA for 70bf749
paddle/phi/api/include/tensor.h
@@ -672,7 +672,7 @@ class PADDLE_API Tensor final {
672
*
673
* @return Tensor
674
*/
675
- Tensor contiguous();
+ Tensor contiguous() const;
676
677
private:
678
/**
paddle/phi/api/lib/tensor.cc
@@ -549,7 +549,7 @@ bool Tensor::is_contiguous() const {
549
}
550
551
552
-Tensor Tensor::contiguous() {
+Tensor Tensor::contiguous() const {
553
if (is_dense_tensor() || is_dist_tensor()) {
554
phi::DenseTensor *dense_tensor = nullptr;
555
if (is_dist_tensor()) {
0 commit comments