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

tflchef operator builder for ResizeNearestNeighbor More...

#include <ResizeNearestNeighbor.h>

Collaboration diagram for tflchef::TFliteOpResizeNearestNeighbor:

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 ResizeNearestNeighbor

Definition at line 28 of file ResizeNearestNeighbor.h.

Member Function Documentation

◆ build()

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

Implements tflchef::TFliteOpChef.

Definition at line 41 of file ResizeNearestNeighbor.cpp.

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

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

◆ filler()

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

Implements tflchef::TFliteOpChef.

Definition at line 24 of file ResizeNearestNeighbor.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: