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

tflchef operator builder for Transpose More...

#include <Transpose.h>

Collaboration diagram for tflchef::TFliteOpTranspose:

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 Transpose

Definition at line 28 of file Transpose.h.

Member Function Documentation

◆ build()

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

Implements tflchef::TFliteOpChef.

Definition at line 36 of file Transpose.cpp.

37{
38 tflchef::Operation *operation = ctx->chefop;
39 const tflite::Operator *op = ctx->tflop;
40
41 operation->set_type("Transpose");
42
43 // No options for Transpose
44
45 return operation;
46}

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

◆ filler()

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

Implements tflchef::TFliteOpChef.

Definition at line 24 of file Transpose.cpp.

26{
27 const auto &inputs = *op->inputs();
28
29 const tflite::Tensor *perm_tensor = import->tensors()->Get(inputs[1]);
30 assert(perm_tensor->type() == tflite::TensorType::TensorType_INT32);
31 const tflite::Buffer *buffer = import->buffers()->Get(perm_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: