Skip to content

Commit 32c979e

Browse files
authored
[Typos] Rename namespace for TensorFormatter (#74287)
* rename namespace for TensorFormatter * fix error
1 parent 33b4fd5 commit 32c979e

File tree

7 files changed

+9
-13
lines changed

7 files changed

+9
-13
lines changed

paddle/fluid/framework/new_executor/instruction/control_flow/assert_instruction.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void AssertInstruction::Run() {
7575
return;
7676
}
7777

78-
funcs::TensorFormatter formatter;
78+
phi::funcs::TensorFormatter formatter;
7979
formatter.SetSummarize(
8080
op_->attribute<::pir::Int64Attribute>("summarize").data());
8181

paddle/fluid/operators/assert_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class AssertOp : public framework::OperatorBase {
7373
return;
7474
}
7575

76-
funcs::TensorFormatter formatter;
76+
phi::funcs::TensorFormatter formatter;
7777
formatter.SetSummarize(Attr<int64_t>(kSummarize.data()));
7878

7979
const std::vector<std::string> &x_names = Inputs(kData.data());

paddle/fluid/operators/print_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class PrintOp : public framework::OperatorBase {
8787
int first_n = Attr<int>("first_n");
8888
if (first_n > 0 && ++times_ > first_n) return;
8989

90-
funcs::TensorFormatter formatter;
90+
phi::funcs::TensorFormatter formatter;
9191
const std::string &name =
9292
Attr<bool>("print_tensor_name") ? printed_var_name : "";
9393
formatter.SetPrintTensorType(Attr<bool>("print_tensor_type"));

paddle/phi/kernels/assert_kernel.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void AssertKernel(const Context& dev_ctx,
3131
return;
3232
}
3333

34-
paddle::funcs::TensorFormatter formatter;
34+
phi::funcs::TensorFormatter formatter;
3535
formatter.SetSummarize(summarize);
3636

3737
for (size_t i = 0; i < data.size(); ++i) {

paddle/phi/kernels/funcs/tensor_formatter.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
#include "paddle/phi/common/place.h"
2121
#include "paddle/phi/core/tensor_utils.h"
2222

23-
namespace paddle {
24-
namespace funcs {
23+
namespace phi::funcs {
2524

2625
void TensorFormatter::SetPrintTensorType(bool print_tensor_type) {
2726
print_tensor_type_ = print_tensor_type;
@@ -185,5 +184,4 @@ template void TensorFormatter::FormatData<phi::dtype::complex<float>>(
185184
template void TensorFormatter::FormatData<phi::dtype::complex<double>>(
186185
const phi::DenseTensor& print_tensor, std::stringstream& log_stream);
187186

188-
} // namespace funcs
189-
} // namespace paddle
187+
} // namespace phi::funcs

paddle/phi/kernels/funcs/tensor_formatter.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ namespace phi {
2121
class DenseTensor;
2222
} // namespace phi
2323

24-
namespace paddle {
25-
namespace funcs {
24+
namespace phi::funcs {
2625

2726
class TensorFormatter {
2827
public:
@@ -54,5 +53,4 @@ class TensorFormatter {
5453
bool print_tensor_layout_ = true;
5554
};
5655

57-
} // namespace funcs
58-
} // namespace paddle
56+
} // namespace phi::funcs

paddle/phi/kernels/impl/data_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void PrintKernel(const Context& dev_ctx,
105105
// if (first_n > 0 && ++times_ > first_n) return;
106106

107107
// TODO(phlrain): support printed_var_name
108-
paddle::funcs::TensorFormatter formatter;
108+
phi::funcs::TensorFormatter formatter;
109109
const std::string& name = print_tensor_name ? "var" : "";
110110
formatter.SetPrintTensorType(print_tensor_type);
111111
formatter.SetPrintTensorShape(print_tensor_shape);

0 commit comments

Comments
 (0)