Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void AssertInstruction::Run() {
return;
}

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

Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/assert_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class AssertOp : public framework::OperatorBase {
return;
}

funcs::TensorFormatter formatter;
phi::funcs::TensorFormatter formatter;
formatter.SetSummarize(Attr<int64_t>(kSummarize.data()));

const std::vector<std::string> &x_names = Inputs(kData.data());
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/print_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class PrintOp : public framework::OperatorBase {
int first_n = Attr<int>("first_n");
if (first_n > 0 && ++times_ > first_n) return;

funcs::TensorFormatter formatter;
phi::funcs::TensorFormatter formatter;
const std::string &name =
Attr<bool>("print_tensor_name") ? printed_var_name : "";
formatter.SetPrintTensorType(Attr<bool>("print_tensor_type"));
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/assert_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void AssertKernel(const Context& dev_ctx,
return;
}

paddle::funcs::TensorFormatter formatter;
phi::funcs::TensorFormatter formatter;
formatter.SetSummarize(summarize);

for (size_t i = 0; i < data.size(); ++i) {
Expand Down
6 changes: 2 additions & 4 deletions paddle/phi/kernels/funcs/tensor_formatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
#include "paddle/phi/common/place.h"
#include "paddle/phi/core/tensor_utils.h"

namespace paddle {
namespace funcs {
namespace phi::funcs {

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

} // namespace funcs
} // namespace paddle
} // namespace phi::funcs
6 changes: 2 additions & 4 deletions paddle/phi/kernels/funcs/tensor_formatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ namespace phi {
class DenseTensor;
} // namespace phi

namespace paddle {
namespace funcs {
namespace phi::funcs {

class TensorFormatter {
public:
Expand Down Expand Up @@ -54,5 +53,4 @@ class TensorFormatter {
bool print_tensor_layout_ = true;
};

} // namespace funcs
} // namespace paddle
} // namespace phi::funcs
2 changes: 1 addition & 1 deletion paddle/phi/kernels/impl/data_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void PrintKernel(const Context& dev_ctx,
// if (first_n > 0 && ++times_ > first_n) return;

// TODO(phlrain): support printed_var_name
paddle::funcs::TensorFormatter formatter;
phi::funcs::TensorFormatter formatter;
const std::string& name = print_tensor_name ? "var" : "";
formatter.SetPrintTensorType(print_tensor_type);
formatter.SetPrintTensorShape(print_tensor_shape);
Expand Down