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

tflchef operator builder for CumSum More...

#include <CumSum.h>

Collaboration diagram for tflchef::TFliteOpCumsum:

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 CumSum

Definition at line 28 of file CumSum.h.

Member Function Documentation

◆ build()

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

Implements tflchef::TFliteOpChef.

Definition at line 36 of file CumSum.cpp.

37{
38 tflchef::Operation *operation = ctx->chefop;
39 const tflite::Operator *op = ctx->tflop;
40
41 auto op_params = op->builtin_options_as_CumsumOptions();
42 assert(op_params != nullptr);
43
44 operation->set_type("CumSum");
45 auto op_options = operation->mutable_cumsum_options();
46
47 op_options->set_exclusive(op_params->exclusive());
48 op_options->set_reverse(op_params->reverse());
49
50 return operation;
51}

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

◆ filler()

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

Implements tflchef::TFliteOpChef.

Definition at line 24 of file CumSum.cpp.

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

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