| 1714 | }; |
| 1715 | |
| 1716 | class Pack : public BuiltinOperator<PackOperator, ::tflite::PackOptions, |
| 1717 | ::tflite::BuiltinOptions_PackOptions> { |
| 1718 | public: |
| 1719 | using BuiltinOperator::BuiltinOperator; |
| 1720 | |
| 1721 | flatbuffers::Offset<TfLiteOptions> WriteOptions( |
| 1722 | const TocoOperator& op, |
| 1723 | flatbuffers::FlatBufferBuilder* builder) const override { |
| 1724 | return ::tflite::CreatePackOptions(*builder, op.values_count, op.axis); |
| 1725 | } |
| 1726 | |
| 1727 | void ReadOptions(const TfLiteOptions& options, |
| 1728 | TocoOperator* op) const override { |
| 1729 | op->values_count = options.values_count(); |
| 1730 | op->axis = options.axis(); |
| 1731 | } |
| 1732 | |
| 1733 | int GetVersion(const OperatorSignature& op_signature) const override { |
| 1734 | const string& input_name = op_signature.op->inputs[0]; |
| 1735 | const Array& input_array = op_signature.model->GetArray(input_name); |
| 1736 | // If the op take int8 input, it is version 2. |
| 1737 | if (input_array.data_type == ArrayDataType::kInt8) { |
| 1738 | return 2; |
| 1739 | } |
| 1740 | return 1; |
| 1741 | } |
| 1742 | }; |
| 1743 | |
| 1744 | class Shape |
| 1745 | : public BuiltinOperator<TensorFlowShapeOperator, ::tflite::ShapeOptions, |
no outgoing calls
no test coverage detected