ONE - On-device Neural Engine
Loading...
Searching...
No Matches
tflchef::TFliteOpFullyConnected Class Reference

tflchef operator builder for FullyConnected More...

#include <FullyConnected.h>

Collaboration diagram for tflchef::TFliteOpFullyConnected:

Public Member Functions

void filler (const tflite::Operator *op, TFliteImport *import, tflchef::ModelRecipe *model_recipe) const override
 
tflchef::Operation * build (RecipeChefContext *ctx) const override
 
- Public Member Functions inherited from tflchef::TFliteOpChef
virtual ~TFliteOpChef ()
 

Detailed Description

tflchef operator builder for FullyConnected

Definition at line 28 of file FullyConnected.h.

Member Function Documentation

◆ build()

tflchef::Operation * tflchef::TFliteOpFullyConnected::build ( RecipeChefContext ctx) const
overridevirtual

Implements tflchef::TFliteOpChef.

Definition at line 38 of file FullyConnected.cpp.

39{
40 tflchef::Operation *operation = ctx->chefop;
41 const tflite::Operator *op = ctx->tflop;
42
43 auto op_params = op->builtin_options_as_FullyConnectedOptions();
44 assert(op_params != nullptr);
45
46 operation->set_type("FullyConnected");
47
48 auto op_options = operation->mutable_fullyconnected_options();
49
50 op_options->set_activation(as_tflchef_activation(op_params->fused_activation_function()));
51 op_options->set_keep_num_dims(op_params->keep_num_dims());
52
53 return operation;
54}
tflchef::Activation as_tflchef_activation(const tflite::ActivationFunctionType type)
Definition Convert.cpp:50

References tflchef::as_tflchef_activation(), tflchef::RecipeChefContext::chefop, and tflchef::RecipeChefContext::tflop.

◆ filler()

void tflchef::TFliteOpFullyConnected::filler ( const tflite::Operator *  op,
TFliteImport import,
tflchef::ModelRecipe *  model_recipe 
) const
overridevirtual

Implements tflchef::TFliteOpChef.

Definition at line 25 of file FullyConnected.cpp.

27{
28 const auto &inputs = *op->inputs();
29
30 for (uint32_t idx = 1; idx < inputs.size(); idx++)
31 {
32 // optional input tensor idx has minus value.
33 if (inputs[idx] >= 0)
34 fill_tensor_to_import(inputs[idx], import);
35 }
36}
void fill_tensor_to_import(int32_t idx, TFliteImport *import)

References tflchef::fill_tensor_to_import().


The documentation for this class was generated from the following files: