From 814c22b801e38ffdd575f9c4e697129f93d72825 Mon Sep 17 00:00:00 2001 From: zoooo0820 Date: Wed, 10 May 2023 08:36:25 +0000 Subject: [PATCH 1/2] up warning level --- paddle/fluid/pybind/eager_method.cc | 4 ++-- paddle/fluid/pybind/imperative.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/pybind/eager_method.cc b/paddle/fluid/pybind/eager_method.cc index 0092bccba7028..1e4eacf99a2bf 100644 --- a/paddle/fluid/pybind/eager_method.cc +++ b/paddle/fluid/pybind/eager_method.cc @@ -136,7 +136,7 @@ static PyObject* tensor_method_numpy(TensorObject* self, } if (set_to_1d) { // 0D Tensor hack process to 1D numpy, will remove in release 2.6 - VLOG(0) + VLOG(1) << "Warning:: 0D Tensor cannot be used as 'Tensor.numpy()[0]' . In " "order to avoid this problem, " "0D Tensor will be changed to 1D numpy currently, but it's not " @@ -930,7 +930,7 @@ static PyObject* tensor__getitem_index_not_tensor(TensorObject* self, // with FLAGS_set_to_1d=True. In this case, one `None` should be pop out, // otherwise the output shape will be not correct. if (static_cast(decrease_axis.size()) == tensor->dims().size()) { - VLOG(0) + VLOG(1) << "Warning: In Tensor '__getitem__', if the number of scalar " "elements " "in the index is equal to the rank of the Tensor, the output " diff --git a/paddle/fluid/pybind/imperative.cc b/paddle/fluid/pybind/imperative.cc index 52a05dc0ffceb..0ccac2ff23661 100644 --- a/paddle/fluid/pybind/imperative.cc +++ b/paddle/fluid/pybind/imperative.cc @@ -1078,7 +1078,7 @@ void BindImperative(py::module *m_ptr) { // not correct. if (static_cast(decrease_axis.size()) == tensor->dims().size()) { - VLOG(0) << "Warning: In Tensor '__getitem__', if the number " + VLOG(1) << "Warning: In Tensor '__getitem__', if the number " "of scalar " "elements " "in the index is equal to the rank of the Tensor, " From 5ee2ece21158061ca28828fced4f787c574de2d2 Mon Sep 17 00:00:00 2001 From: zoooo0820 Date: Wed, 10 May 2023 10:27:59 +0000 Subject: [PATCH 2/2] numpy still vlog-0 --- paddle/fluid/pybind/eager_method.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/pybind/eager_method.cc b/paddle/fluid/pybind/eager_method.cc index 1e4eacf99a2bf..3f023d36490a7 100644 --- a/paddle/fluid/pybind/eager_method.cc +++ b/paddle/fluid/pybind/eager_method.cc @@ -136,7 +136,7 @@ static PyObject* tensor_method_numpy(TensorObject* self, } if (set_to_1d) { // 0D Tensor hack process to 1D numpy, will remove in release 2.6 - VLOG(1) + VLOG(0) << "Warning:: 0D Tensor cannot be used as 'Tensor.numpy()[0]' . In " "order to avoid this problem, " "0D Tensor will be changed to 1D numpy currently, but it's not "