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

tflchef operator builder for Fill More...

#include <Fill.h>

Collaboration diagram for tflchef::TFliteOpFill:

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 Fill

Definition at line 28 of file Fill.h.

Member Function Documentation

◆ build()

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

Implements tflchef::TFliteOpChef.

Definition at line 36 of file Fill.cpp.

37{
38 tflchef::Operation *operation = ctx->chefop;
39 const tflite::Operator *op = ctx->tflop;
40 operation->set_type("Fill");
41
42 // FillOptions are empty
43
44 return operation;
45}

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

◆ filler()

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

Implements tflchef::TFliteOpChef.

Definition at line 24 of file Fill.cpp.

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

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