MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CheckResults

Method CheckResults

tensorflow/lite/testing/tflite_driver.cc:473–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471}
472
473bool TfLiteDriver::CheckResults() {
474 if (!IsValid()) return false;
475 bool success = true;
476 for (const auto& p : expected_output_) {
477 int id = p.first;
478 auto* tensor = interpreter_->tensor(id);
479 if (!p.second->Check(/*verbose=*/false, *tensor)) {
480 // Do not invalidate anything here. Instead, simply output the
481 // differences and return false. Invalidating would prevent all
482 // subsequent invocations from running..
483 std::cerr << "There were errors in invocation '" << GetInvocationId()
484 << "', output tensor '" << id << "':" << std::endl;
485 p.second->Check(/*verbose=*/true, *tensor);
486 success = false;
487 SetOverallSuccess(false);
488 }
489 }
490 for (const auto& p : expected_output_shape_) {
491 int id = p.first;
492 auto* tensor = interpreter_->tensor(id);
493 if (!p.second->CheckShape(/*verbose=*/false, *tensor)) {
494 // Do not invalidate anything here. Instead, simply output the
495 // differences and return false. Invalidating would prevent all
496 // subsequent invocations from running..
497 std::cerr << "There were errors in invocation '" << GetInvocationId()
498 << "', output tensor '" << id << "':" << std::endl;
499 p.second->CheckShape(/*verbose=*/true, *tensor);
500 success = false;
501 SetOverallSuccess(false);
502 }
503 }
504 expected_output_.clear();
505 return success;
506}
507
508void TfLiteDriver::ResetLSTMStateTensors() {
509 interpreter_->ResetVariableTensors();

Callers 2

FinishMethod · 0.45
TESTFunction · 0.45

Calls 5

IsValidFunction · 0.85
tensorMethod · 0.45
CheckMethod · 0.45
CheckShapeMethod · 0.45
clearMethod · 0.45

Tested by 2

FinishMethod · 0.36
TESTFunction · 0.36