ONE - On-device Neural Engine
Loading...
Searching...
No Matches
AllChef Class Referencefinal

#include <All.h>

Collaboration diagram for AllChef:

Public Member Functions

 AllChef (const tflchef::Operation *operation)
 
tflite::BuiltinOperator code (void) const override
 
tflite::BuiltinOptions type (void) const override
 
flatbuffers::Offset< void > value (flatbuffers::FlatBufferBuilder &fbb) const override
 
flatbuffers::Offset< flatbuffers::Vector< uint8_t > > custom_value (flatbuffers::FlatBufferBuilder &fbb) const override
 
- Public Member Functions inherited from OpChef
virtual ~OpChef ()=default
 
virtual ~OpChef ()=default
 

Detailed Description

Definition at line 22 of file All.h.

Constructor & Destructor Documentation

◆ AllChef()

AllChef::AllChef ( const tflchef::Operation *  operation)
inlineexplicit

Definition at line 25 of file All.h.

25 : _operation{operation}
26 {
27 // DO NOTHING
28 }

Member Function Documentation

◆ code()

tflite::BuiltinOperator AllChef::code ( void  ) const
inlineoverridevirtual

Implements OpChef.

Definition at line 31 of file All.h.

31{ return tflite::BuiltinOperator_CUSTOM; }

◆ custom_value()

flatbuffers::Offset< flatbuffers::Vector< uint8_t > > AllChef::custom_value ( flatbuffers::FlatBufferBuilder fbb) const
overridevirtual

REGISTER_OP("All") .Input("input: bool") .Input("reduction_indices: Tidx") .Output("output: bool") .Attr("keep_dims: bool = false") .Attr("Tidx: {int32, int64} = DT_INT32") .SetShapeFn(shape_inference::ReductionShape);

Reimplemented from OpChef.

Definition at line 29 of file All.cpp.

30{
31 auto &operation = (*_operation);
32
33 check_custom_op_value(operation, "All");
34
45 auto flex_buffers = std::make_unique<flexbuffers::Builder>();
46 size_t map_start = flex_buffers->StartMap();
47
48 // TODO Support more data types
49 flex_buffers->Int("Tidx", tflite::TensorType_INT32);
50 flex_buffers->Bool("keep_dims", operation.all_options().keep_dims());
51
52 flex_buffers->EndMap(map_start);
53 flex_buffers->Finish();
54
55 auto circle_custom_options = fbb.CreateVector(flex_buffers->GetBuffer());
57}
void check_custom_op_value(const tflchef::Operation &operation, const std::string &op_type)
Definition OpUtils.cpp:21
Offset< Vector< T > > CreateVector(const T *v, size_t len)
Serialize an array into a FlatBuffer vector.
flatbuffers::Offset< flatbuffers::Vector< uint8_t > > circle_custom_options(flatbuffers::FlatBufferBuilder &fb, const luci::CircleNode *node)

References check_custom_op_value(), and flatbuffers::FlatBufferBuilder::CreateVector().

◆ type()

tflite::BuiltinOptions AllChef::type ( void  ) const
inlineoverridevirtual

Implements OpChef.

Definition at line 33 of file All.h.

33{ return tflite::BuiltinOptions_NONE; }

◆ value()

flatbuffers::Offset< void > AllChef::value ( flatbuffers::FlatBufferBuilder fbb) const
overridevirtual

Implements OpChef.

Definition at line 23 of file All.cpp.


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