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

Function CheckValidOutput

paddle/fluid/framework/device_worker.cc:229–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229bool CheckValidOutput(phi::DenseTensor* tensor, size_t batch_size) {
230 auto& dims = tensor->dims();
231 if (dims.size() != 2) return false;
232 if (!tensor->lod().empty()) {
233 auto& lod = tensor->lod()[0];
234 if (lod.size() != batch_size + 1) {
235 return false;
236 }
237 } else {
238 if (dims[0] != static_cast<int>(batch_size)) {
239 return false;
240 }
241 }
242 return true;
243}
244
245void DeviceWorker::DumpParam(const Scope& scope, const int batch_id) {
246 std::ostringstream os;

Callers 2

DumpFieldMethod · 0.85
TESTFunction · 0.85

Calls 4

dimsMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
lodMethod · 0.45

Tested by 1

TESTFunction · 0.68