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

#include <MatrixBandPart.h>

Collaboration diagram for MatrixBandPartChef:

Public Member Functions

 MatrixBandPartChef (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 MatrixBandPart.h.

Constructor & Destructor Documentation

◆ MatrixBandPartChef()

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

Definition at line 25 of file MatrixBandPart.h.

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

Member Function Documentation

◆ code()

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

Implements OpChef.

Definition at line 31 of file MatrixBandPart.h.

31{ return tflite::BuiltinOperator_CUSTOM; }

◆ custom_value()

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

REGISTER_OP("MatrixBandPart") .Input("input: T") .Input("num_lower: Tindex") .Input("num_upper: Tindex") .Output("band: T") .Attr("T: type") .Attr("Tindex: {int32, int64} = DT_INT64") .SetShapeFn(shape_inference::UnchangedShape);

Reimplemented from OpChef.

Definition at line 29 of file MatrixBandPart.cpp.

30{
31 auto &operation = (*_operation);
32
33 check_custom_op_value(operation, "MatrixBandPart");
34
46 auto flex_buffers = std::make_unique<flexbuffers::Builder>();
47 size_t map_start = flex_buffers->StartMap();
48
49 // TODO Support more data types
50 flex_buffers->Int("T", tflite::TensorType_FLOAT32);
51 flex_buffers->Int("Tindex", tflite::TensorType_INT64);
52
53 flex_buffers->EndMap(map_start);
54 flex_buffers->Finish();
55
56 auto circle_custom_options = fbb.CreateVector(flex_buffers->GetBuffer());
58}
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 MatrixBandPartChef::type ( void  ) const
inlineoverridevirtual

Implements OpChef.

Definition at line 33 of file MatrixBandPart.h.

33{ return tflite::BuiltinOptions_NONE; }

◆ value()

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

Implements OpChef.

Definition at line 23 of file MatrixBandPart.cpp.


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