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

Function TEST

tensorflow/lite/toco/tflite/export_test.cc:669–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

667}
668
669TEST(OperatorKeyTest, TestBuiltinOp) {
670 Model model;
671 auto op = absl::make_unique<ConvOperator>();
672
673 // Test a normal float operation.
674 op->inputs = {"input", "filter"};
675 op->outputs = {"output"};
676 Array& input_array = model.GetOrCreateArray(op->inputs[0]);
677 Array& filter_array = model.GetOrCreateArray(op->inputs[1]);
678 Array& output_array = model.GetOrCreateArray(op->outputs[0]);
679 input_array.data_type = ArrayDataType::kFloat;
680 filter_array.data_type = ArrayDataType::kFloat;
681 output_array.data_type = ArrayDataType::kFloat;
682
683 const auto ops_by_type = BuildOperatorByTypeMap();
684 const toco::OperatorSignature op_signature = {op.get(), &model};
685 const auto key = details::OperatorKey(op_signature, ops_by_type, false);
686
687 EXPECT_EQ(key.type(), ::tflite::BuiltinOperator_CONV_2D);
688 EXPECT_EQ(key.custom_code(), "");
689 EXPECT_EQ(key.version(), 1);
690}
691
692TEST(OperatorKeyTest, TestBuiltinOpWithVersionedInputTypes) {
693 Model model;

Callers

nothing calls this directly

Calls 11

BuildOperatorByTypeMapFunction · 0.85
OperatorKeyClass · 0.85
is_custom_opMethod · 0.80
is_flex_opMethod · 0.80
set_opMethod · 0.80
typeMethod · 0.65
getMethod · 0.45
versionMethod · 0.45
set_nameMethod · 0.45
SerializeToStringMethod · 0.45

Tested by

no test coverage detected