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

Method WriteOptions

tensorflow/lite/toco/tflite/operator.cc:447–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 2

SerializeFunction · 0.85

Tested by

no test coverage detected