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

tflchef operator builder for abs More...

#include <Range.h>

Collaboration diagram for tflchef::TFliteOpRange:

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 abs

Definition at line 28 of file Range.h.

Member Function Documentation

◆ build()

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

Implements tflchef::TFliteOpChef.

Definition at line 51 of file Range.cpp.

52{
53 tflchef::Operation *operation = ctx->chefop;
54 const tflite::Operator *op = ctx->tflop;
55
56 operation->set_type("Range");
57
58 return operation;
59}

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

◆ filler()

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

Implements tflchef::TFliteOpChef.

Definition at line 24 of file Range.cpp.

26{
27 // filler for all inputs
28 const auto &inputs = *op->inputs();
29
30 for (int index = 0; index < 3; ++index)
31 {
32 const tflite::Tensor *tensor = import->tensors()->Get(inputs[index]);
33 const tflite::Buffer *buffer = import->buffers()->Get(tensor->buffer());
34 if (tensor->type() == tflite::TensorType::TensorType_INT32)
35 {
36 auto vec = extract_buffer<int32_t>(buffer);
37 import->set_tensor_filler(inputs[index], vec);
38 }
39 else if (tensor->type() == tflite::TensorType::TensorType_FLOAT32)
40 {
41 auto vec = extract_buffer<float>(buffer);
42 import->set_tensor_filler(inputs[index], vec);
43 }
44 else
45 {
46 assert(false && "Invalid tensor type");
47 }
48 }
49}
loco::GraphInputIndex index(const TFPlaceholder *node)
Definition TFNode.cpp:54

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