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

tflchef operator builder for Sqrt More...

#include <Sqrt.h>

Collaboration diagram for tflchef::TFliteOpSqrt:

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 Sqrt

Definition at line 28 of file Sqrt.h.

Member Function Documentation

◆ build()

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

Implements tflchef::TFliteOpChef.

Definition at line 43 of file Sqrt.cpp.

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

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

◆ filler()

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

Implements tflchef::TFliteOpChef.

Definition at line 24 of file Sqrt.cpp.

26{
27 // Nothing to do with filler
28 // But input has filler for constant inputs
29 const auto &inputs = *op->inputs();
30
31 const tflite::Tensor *tensor = import->tensors()->Get(inputs[0]);
32 if (tensor->type() == tflite::TensorType::TensorType_FLOAT32)
33 {
34 const tflite::Buffer *buffer = import->buffers()->Get(tensor->buffer());
35 if (buffer && buffer->data())
36 {
37 auto vec = extract_buffer<float>(buffer);
38 import->set_tensor_filler(inputs[0], vec);
39 }
40 }
41}

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