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

tflchef operator builder for GatherNd More...

#include <GatherNd.h>

Collaboration diagram for tflchef::TFliteOpGatherNd:

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 GatherNd

Definition at line 28 of file GatherNd.h.

Member Function Documentation

◆ build()

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

Implements tflchef::TFliteOpChef.

Definition at line 41 of file GatherNd.cpp.

42{
43 tflchef::Operation *operation = ctx->chefop;
44 const tflite::Operator *op = ctx->tflop;
45 operation->set_type("GatherNd");
46
47 return operation;
48}

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

◆ filler()

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

Implements tflchef::TFliteOpChef.

Definition at line 24 of file GatherNd.cpp.

26{
27 // indices 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: