| 445 | public: |
| 446 | using BuiltinOperator::BuiltinOperator; |
| 447 | flatbuffers::Offset<TfLiteOptions> WriteOptions( |
| 448 | const TocoOperator& op, |
| 449 | flatbuffers::FlatBufferBuilder* builder) const override { |
| 450 | auto activation_function = |
| 451 | ActivationFunction::Serialize(op.fused_activation_function); |
| 452 | ::tflite::FullyConnectedOptionsWeightsFormat tflite_weights_format; |
| 453 | switch (op.weights_format) { |
| 454 | case FullyConnectedWeightsFormat::kDefault: |
| 455 | tflite_weights_format = |
| 456 | ::tflite::FullyConnectedOptionsWeightsFormat_DEFAULT; |
| 457 | break; |
| 458 | case FullyConnectedWeightsFormat::kShuffled4x16Int8: |
| 459 | tflite_weights_format = |
| 460 | ::tflite::FullyConnectedOptionsWeightsFormat_SHUFFLED4x16INT8; |
| 461 | break; |
| 462 | default: |
| 463 | LOG(ERROR) << "Unhandled FC weights format"; |
| 464 | tflite_weights_format = |
| 465 | ::tflite::FullyConnectedOptionsWeightsFormat_DEFAULT; |
| 466 | } |
| 467 | return ::tflite::CreateFullyConnectedOptions(*builder, activation_function, |
| 468 | tflite_weights_format); |
| 469 | } |
| 470 | |
| 471 | void ReadOptions(const TfLiteOptions& options, |
| 472 | TocoOperator* op) const override { |
nothing calls this directly
no test coverage detected