tflchef operator builder for REDUCE_PROD
More...
#include <ReduceProd.h>
tflchef operator builder for REDUCE_PROD
Definition at line 28 of file ReduceProd.h.
◆ build()
tflchef::Operation * tflchef::TFliteOpReduceProd::build |
( |
RecipeChefContext * |
ctx | ) |
const |
|
overridevirtual |
Implements tflchef::TFliteOpChef.
Definition at line 37 of file ReduceProd.cpp.
38{
39 tflchef::Operation *operation = ctx->chefop;
40 const tflite::Operator *op = ctx->tflop;
41 operation->set_type("ReduceProd");
42
43 auto op_params = op->builtin_options_as_ReducerOptions();
44 assert(op_params != nullptr);
45
46 auto op_options = operation->mutable_reduce_prod_options();
47 op_options->set_keep_dims(op_params->keep_dims());
48
49 return operation;
50}
References tflchef::RecipeChefContext::chefop, and tflchef::RecipeChefContext::tflop.
◆ filler()
void tflchef::TFliteOpReduceProd::filler |
( |
const tflite::Operator * |
op, |
|
|
TFliteImport * |
import, |
|
|
tflchef::ModelRecipe * |
model_recipe |
|
) |
| const |
|
overridevirtual |
Implements tflchef::TFliteOpChef.
Definition at line 24 of file ReduceProd.cpp.
26{
27
28 const auto &
inputs = *op->inputs();
29
30 const tflite::Tensor *
tensor =
import->tensors()->Get(inputs[1]);
31 assert(
tensor->type() == tflite::TensorType::TensorType_INT32);
32 const tflite::Buffer *buffer =
import->buffers()->Get(
tensor->buffer());
33 auto vec = extract_buffer<int32_t>(buffer);
34 import->set_tensor_filler(inputs[1], vec);
35}
The documentation for this class was generated from the following files: