ONE - On-device Neural Engine
Loading...
Searching...
No Matches
circlechef::CircleOpInstanceNorm Class Reference

circlechef operator builder for INSTANCE_NORM More...

#include <InstanceNorm.h>

Collaboration diagram for circlechef::CircleOpInstanceNorm:

Public Member Functions

void filler (const circle::Operator *op, CircleImport *import, circlechef::ModelRecipe *model_recipe) const override
 
circlechef::Operation * build (const circle::Operator *op, CircleImport *import, circlechef::ModelRecipe *model_recipe) const override
 
- Public Member Functions inherited from circlechef::CircleOpChef
virtual ~CircleOpChef ()
 

Detailed Description

circlechef operator builder for INSTANCE_NORM

Definition at line 28 of file InstanceNorm.h.

Member Function Documentation

◆ build()

circlechef::Operation * circlechef::CircleOpInstanceNorm::build ( const circle::Operator *  op,
CircleImport import,
circlechef::ModelRecipe *  model_recipe 
) const
overridevirtual

Implements circlechef::CircleOpChef.

Definition at line 35 of file InstanceNorm.cpp.

37{
38 auto operation = model_recipe->add_operation();
39
40 operation->set_type("InstanceNorm");
41
42 auto op_options = operation->mutable_instance_norm_options();
43
44 auto op_params = op->builtin_options_as_InstanceNormOptions();
45 assert(op_params != nullptr);
46
47 op_options->set_epsilon(op_params->epsilon());
48 op_options->set_activation(as_circlechef_activation(op_params->fused_activation_function()));
49
50 return operation;
51}
circlechef::Activation as_circlechef_activation(const circle::ActivationFunctionType type)
Definition Convert.cpp:55

References circlechef::as_circlechef_activation().

◆ filler()

void circlechef::CircleOpInstanceNorm::filler ( const circle::Operator *  op,
CircleImport import,
circlechef::ModelRecipe *  model_recipe 
) const
overridevirtual

Implements circlechef::CircleOpChef.

Definition at line 24 of file InstanceNorm.cpp.

26{
27 // index 1 and 2 maybe constant
28 const std::vector<int32_t> &inputs = as_index_vector(op->inputs());
29 assert(inputs.size() == 3);
30
31 import->set_tensor_filler(inputs[1]); // set gaussian filler
32 import->set_tensor_filler(inputs[2]);
33}
std::vector< T > as_index_vector(const flatbuffers::Vector< T > *flat_array)
Definition Convert.h:43

References circlechef::as_index_vector().


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