| 756 | // version. |
| 757 | template <typename Op> |
| 758 | void SimpleVersioningTest() { |
| 759 | Op op; |
| 760 | op.inputs = {"input1"}; |
| 761 | auto operator_by_type_map = BuildOperatorByTypeMap(false /*enable_flex_ops*/); |
| 762 | const BaseOperator* base_op = operator_by_type_map.at(op.type).get(); |
| 763 | |
| 764 | Model uint8_model; |
| 765 | Array& uint8_array = uint8_model.GetOrCreateArray(op.inputs[0]); |
| 766 | uint8_array.data_type = ArrayDataType::kUint8; |
| 767 | OperatorSignature uint8_signature = {.op = &op, .model = &uint8_model}; |
| 768 | EXPECT_EQ(base_op->GetVersion(uint8_signature), 1); |
| 769 | |
| 770 | Model int8_model; |
| 771 | Array& int8_array = int8_model.GetOrCreateArray(op.inputs[0]); |
| 772 | int8_array.data_type = ArrayDataType::kInt8; |
| 773 | OperatorSignature int8_signature = {.op = &op, .model = &int8_model}; |
| 774 | EXPECT_EQ(base_op->GetVersion(int8_signature), 2); |
| 775 | } |
| 776 | |
| 777 | // Test version for a simple Op with 2 versions and the output type controls the |
| 778 | // version. |
nothing calls this directly
no test coverage detected