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

Method SetField

tensorflow/lite/testing/parse_testdata.cc:262–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260 }
261
262 void SetField(const std::string& name, const std::string& value) override {
263 if (name == "id") {
264 test_runner_->SetInvocationId(value);
265 } else if (name == "input") {
266 if (parsed_input_count_ >= expected_inputs_.size()) {
267 return test_runner_->Invalidate("Too many inputs");
268 }
269 test_runner_->SetInput(expected_inputs_[parsed_input_count_], value);
270 ++parsed_input_count_;
271 } else if (name == "output") {
272 if (parsed_output_count_ >= expected_outputs_.size()) {
273 return test_runner_->Invalidate("Too many outputs");
274 }
275 test_runner_->SetExpectation(expected_outputs_[parsed_output_count_],
276 value);
277 ++parsed_output_count_;
278 } else if (name == "output_shape") {
279 if (parsed_output_shape_count_ >= expected_outputs_.size()) {
280 return test_runner_->Invalidate("Too many output shapes");
281 }
282 test_runner_->SetShapeExpectation(
283 expected_outputs_[parsed_output_shape_count_], value);
284 ++parsed_output_shape_count_;
285 }
286 }
287 void Finish() override {
288 test_runner_->Invoke();
289 test_runner_->CheckResults();

Callers

nothing calls this directly

Calls 6

SetInvocationIdMethod · 0.80
sizeMethod · 0.45
InvalidateMethod · 0.45
SetInputMethod · 0.45
SetExpectationMethod · 0.45
SetShapeExpectationMethod · 0.45

Tested by

no test coverage detected