Skip to content

Commit 4f98391

Browse files
authored
Fix (#65840)
1 parent 495a0a3 commit 4f98391

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

paddle/fluid/pybind/eager_method.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ static PyObject* tensor_method_numpy(TensorObject* self,
154154
EAGER_TRY
155155
auto& api = pybind11::detail::npy_api::get();
156156
if (!self->tensor.impl()) {
157-
Py_intptr_t py_dims[paddle::framework::DDim::kMaxRank]; // NOLINT
158-
Py_intptr_t py_strides[paddle::framework::DDim::kMaxRank]; // NOLINT
157+
Py_intptr_t py_dims[phi::DDim::kMaxRank]; // NOLINT
158+
Py_intptr_t py_strides[phi::DDim::kMaxRank]; // NOLINT
159159
py_dims[0] = 0;
160160
py_strides[0] = 0;
161161

@@ -174,8 +174,8 @@ static PyObject* tensor_method_numpy(TensorObject* self,
174174
auto tensor_dims = self->tensor.shape();
175175
auto numpy_dtype = TensorDtype2NumpyDtype(self->tensor.type());
176176
auto sizeof_dtype = phi::SizeOf(self->tensor.type());
177-
Py_intptr_t py_dims[paddle::framework::DDim::kMaxRank]; // NOLINT
178-
Py_intptr_t py_strides[paddle::framework::DDim::kMaxRank]; // NOLINT
177+
Py_intptr_t py_dims[phi::DDim::kMaxRank]; // NOLINT
178+
Py_intptr_t py_strides[phi::DDim::kMaxRank]; // NOLINT
179179
size_t py_rank = tensor_dims.size();
180180
size_t numel = 1;
181181
if (self->tensor.is_dense_tensor()) {
@@ -468,8 +468,8 @@ static PyObject* tensor_method_numpy_for_string_tensor(TensorObject* self,
468468
if (!self->tensor.impl() || !self->tensor.impl()->initialized()) {
469469
VLOG(6) << "The StringTensor is uninitialized. Return the empty string "
470470
"numpy array.";
471-
Py_intptr_t py_dims[paddle::framework::DDim::kMaxRank]; // NOLINT
472-
Py_intptr_t py_strides[paddle::framework::DDim::kMaxRank]; // NOLINT
471+
Py_intptr_t py_dims[phi::DDim::kMaxRank]; // NOLINT
472+
Py_intptr_t py_strides[phi::DDim::kMaxRank]; // NOLINT
473473
py_dims[0] = 0;
474474
py_strides[0] = 0;
475475

@@ -1614,8 +1614,8 @@ static PyObject* tensor__getitem_from_offset(TensorObject* self,
16141614
if (tensor.dtype() == proto_type) { \
16151615
auto numpy_dtype = TensorDtype2NumpyDtype(proto_type); \
16161616
T b = paddle::pybind::TensorGetElement<T>(tensor, offset); \
1617-
Py_intptr_t py_dims[paddle::framework::DDim::kMaxRank]; /* NOLINT */ \
1618-
Py_intptr_t py_strides[paddle::framework::DDim::kMaxRank]; /* NOLINT */ \
1617+
Py_intptr_t py_dims[phi::DDim::kMaxRank]; /* NOLINT */ \
1618+
Py_intptr_t py_strides[phi::DDim::kMaxRank]; /* NOLINT */ \
16191619
auto& api = pybind11::detail::npy_api::get(); \
16201620
PyObject* array = api.PyArray_NewFromDescr_( \
16211621
api.PyArray_Type_, \

paddle/fluid/pybind/reader_py.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class MultiDeviceFeedReader {
153153
ret_(),
154154
drop_last_(drop_last),
155155
pin_memory_(pin_memory) {
156-
std::vector<framework::DDim> dims;
156+
std::vector<phi::DDim> dims;
157157
for (auto &shape : shapes) {
158158
dims.push_back(common::make_ddim(shape));
159159
}

paddle/fluid/pybind/tensor_py.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ inline void _getSliceinfo(const phi::DenseTensor &self,
768768
auto &stop = *pstop;
769769
auto &step = *pstep;
770770
auto &slicelength = *pslicelength;
771-
const framework::DDim &srcDDim = self.dims();
771+
const phi::DDim &srcDDim = self.dims();
772772
PADDLE_ENFORCE(
773773
0 <= dim && dim < srcDDim.size(),
774774
platform::errors::OutOfRange("The dim %d of slice is out of bounds, it "
@@ -810,7 +810,7 @@ inline void _getSliceinfo(const phi::DenseTensor &self,
810810
}
811811

812812
inline phi::DenseTensor *_getTensor(const phi::DenseTensor &self,
813-
const framework::DDim &ddim) {
813+
const phi::DDim &ddim) {
814814
phi::DenseTensor *output = new phi::DenseTensor();
815815
output->Resize(ddim);
816816
auto place = self.place();
@@ -881,7 +881,7 @@ inline phi::DenseTensor *_sliceWrapper(const phi::DenseTensor &self,
881881
int dim,
882882
int64_t start,
883883
int64_t slicelength) {
884-
framework::DDim dstDDim = self.dims();
884+
phi::DDim dstDDim = self.dims();
885885
dstDDim[dim] = static_cast<int64_t>(slicelength);
886886
std::vector<int> axes({dim});
887887
std::vector<int> starts({static_cast<int>(start)});
@@ -906,7 +906,7 @@ inline phi::DenseTensor *_sliceAndConcat(const phi::DenseTensor &self,
906906
}
907907

908908
// do the concat operation
909-
framework::DDim dstDDim = self.dims();
909+
phi::DDim dstDDim = self.dims();
910910
dstDDim[dim] = static_cast<int64_t>(slicelength);
911911
phi::DenseTensor *output1 = _getTensor(self, dstDDim);
912912
_concatCompute<T>(ins, output1, ctx, dim);

0 commit comments

Comments
 (0)