MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / PrintDenseTensor

Function PrintDenseTensor

paddle/fluid/framework/device_worker.cc:167–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167std::string PrintDenseTensor(phi::DenseTensor* tensor,
168 int64_t start,
169 int64_t end,
170 char separator,
171 bool need_leading_separator) {
172 std::string out_val;
173 if (framework::TransToProtoVarType(tensor->dtype()) == proto::VarType::FP32) {
174 out_val = PrintDenseTensorType<float>(
175 tensor, start, end, separator, need_leading_separator);
176 } else if (framework::TransToProtoVarType(tensor->dtype()) ==
177 proto::VarType::INT64) {
178 out_val = PrintDenseTensorIntType(
179 tensor, start, end, separator, need_leading_separator);
180 } else if (framework::TransToProtoVarType(tensor->dtype()) ==
181 proto::VarType::FP64) {
182 out_val = PrintDenseTensorType<double>(
183 tensor, start, end, separator, need_leading_separator);
184 } else {
185 out_val = "unsupported type";
186 }
187 return out_val;
188}
189
190void PrintDenseTensor(phi::DenseTensor* tensor,
191 int64_t start,

Callers 4

TrainFilesMethod · 0.85
DumpParamMethod · 0.85
DumpFieldMethod · 0.85
TESTFunction · 0.85

Calls 3

PrintDenseTensorIntTypeFunction · 0.85
TransToProtoVarTypeFunction · 0.70
dtypeMethod · 0.45

Tested by 1

TESTFunction · 0.68