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

tflchef operator builder for ResizeBilinear More...

#include <ResizeBilinear.h>

Collaboration diagram for tflchef::TFliteOpResizeBilinear:

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 ResizeBilinear

Definition at line 28 of file ResizeBilinear.h.

Member Function Documentation

◆ build()

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

Implements tflchef::TFliteOpChef.

Definition at line 41 of file ResizeBilinear.cpp.

42{
43 tflchef::Operation *operation = ctx->chefop;
44 const tflite::Operator *op = ctx->tflop;
45
46 auto op_params = op->builtin_options_as_ResizeBilinearOptions();
47 assert(op_params != nullptr);
48
49 operation->set_type("ResizeBilinear");
50
51 auto op_options = operation->mutable_resize_bilinear_options();
52
53 op_options->set_align_corners(op_params->align_corners());
54 op_options->set_half_pixel_centers(op_params->half_pixel_centers());
55
56 return operation;
57}

References tflchef::RecipeChefContext::chefop, and tflchef::RecipeChefContext::tflop.

◆ filler()

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

Implements tflchef::TFliteOpChef.

Definition at line 24 of file ResizeBilinear.cpp.

26{
27 // size buffer has filler
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
34 if (buffer && buffer->data())
35 {
36 auto vec = extract_buffer<int32_t>(buffer);
37 import->set_tensor_filler(inputs[1], vec);
38 }
39}

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