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

tflchef operator builder for SLICE More...

#include <Slice.h>

Collaboration diagram for tflchef::TFliteOpSlice:

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 SLICE

Definition at line 28 of file Slice.h.

Member Function Documentation

◆ build()

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

Implements tflchef::TFliteOpChef.

Definition at line 40 of file Slice.cpp.

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

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

◆ filler()

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

Implements tflchef::TFliteOpChef.

Definition at line 24 of file Slice.cpp.

26{
27 const std::vector<int32_t> &inputs = as_index_vector(op->inputs());
28
29 // for begin and size
30 for (int32_t index = 1; index <= 2; ++index)
31 {
32 const tflite::Tensor *tensor = import->tensors()->Get(inputs[index]);
33 assert(tensor->type() == tflite::TensorType::TensorType_INT32);
34 const tflite::Buffer *buffer = import->buffers()->Get(tensor->buffer());
35 auto vec = extract_buffer<int32_t>(buffer);
36 import->set_tensor_filler(inputs[index], vec);
37 }
38}
loco::GraphInputIndex index(const TFPlaceholder *node)
Definition TFNode.cpp:54
std::vector< T > as_index_vector(const flatbuffers::Vector< T > *flat_array)
Definition Convert.h:47

References tflchef::as_index_vector().


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