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

tflchef operator builder for MIRROR_PAD More...

#include <MirrorPad.h>

Collaboration diagram for tflchef::TFliteOpMirrorPad:

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 MIRROR_PAD

Definition at line 28 of file MirrorPad.h.

Member Function Documentation

◆ build()

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

Implements tflchef::TFliteOpChef.

Definition at line 37 of file MirrorPad.cpp.

38{
39 tflchef::Operation *operation = ctx->chefop;
40 const tflite::Operator *op = ctx->tflop;
41 operation->set_type("MirrorPad");
42
43 auto op_options = operation->mutable_mirrorpad_options();
44
45 auto op_params = op->builtin_options_as_MirrorPadOptions();
46 assert(op_params != nullptr);
47
48 op_options->set_mode(as_tflchef_mirrorpadmode(op_params->mode()));
49
50 return operation;
51}
tflchef::MirrorPadMode as_tflchef_mirrorpadmode(const tflite::MirrorPadMode mode)
Definition Convert.cpp:84

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

◆ filler()

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

Implements tflchef::TFliteOpChef.

Definition at line 24 of file MirrorPad.cpp.

26{
27 // filler for second input
28 const auto &inputs = *op->inputs();
29
30 const tflite::Tensor *tensor = import->tensors()->Get(inputs[1]);
31 assert(tensor->type() == tflite::TensorType::TensorType_INT32);
32 const tflite::Buffer *buffer = import->buffers()->Get(tensor->buffer());
33 auto vec = extract_buffer<int32_t>(buffer);
34 import->set_tensor_filler(inputs[1], vec);
35}

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