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

circlechef operator builder for RoPE More...

#include <RoPE.h>

Collaboration diagram for circlechef::CircleOpRoPE:

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 RoPE

Definition at line 28 of file RoPE.h.

Member Function Documentation

◆ build()

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

Implements circlechef::CircleOpChef.

Definition at line 35 of file RoPE.cpp.

37{
38 auto operation = model_recipe->add_operation();
39
40 operation->set_type("RoPE");
41
42 auto op_options = operation->mutable_rope_options();
43
44 auto op_params = op->builtin_options_as_RoPEOptions();
45 assert(op_params != nullptr);
46
47 op_options->set_mode(op_params->mode());
48
49 return operation;
50}

◆ filler()

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

Implements circlechef::CircleOpChef.

Definition at line 24 of file RoPE.cpp.

26{
27 const std::vector<int32_t> &inputs = as_index_vector(op->inputs());
28
29 assert(inputs.size() == 3);
30
31 import->set_tensor_filler(inputs[1]);
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: