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

circlechef operator builder for RMS_NORM More...

#include <RmsNorm.h>

Collaboration diagram for circlechef::CircleOpRmsNorm:

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 RMS_NORM

Definition at line 28 of file RmsNorm.h.

Member Function Documentation

◆ build()

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

Implements circlechef::CircleOpChef.

Definition at line 34 of file RmsNorm.cpp.

36{
37 auto operation = model_recipe->add_operation();
38
39 operation->set_type("RmsNorm");
40
41 auto op_options = operation->mutable_rms_norm_options();
42
43 auto op_params = op->builtin_options_as_RmsNormOptions();
44 assert(op_params != nullptr);
45
46 op_options->set_epsilon(op_params->epsilon());
47
48 return operation;
49}

◆ filler()

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

Implements circlechef::CircleOpChef.

Definition at line 24 of file RmsNorm.cpp.

26{
27 // index 1 maybe constant
28 const std::vector<int32_t> &inputs = as_index_vector(op->inputs());
29 assert(inputs.size() == 2);
30
31 import->set_tensor_filler(inputs[1]); // set gaussian filler
32}
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: