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

#include <Reshape.h>

Collaboration diagram for ReshapeChef:

Public Member Functions

 ReshapeChef (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
 
- Public Member Functions inherited from OpChef
virtual ~OpChef ()=default
 
virtual flatbuffers::Offset< flatbuffers::Vector< uint8_t > > custom_value (flatbuffers::FlatBufferBuilder &fbb) const
 
virtual ~OpChef ()=default
 
virtual flatbuffers::Offset< flatbuffers::Vector< uint8_t > > custom_value (flatbuffers::FlatBufferBuilder &fbb) const
 

Detailed Description

Definition at line 22 of file Reshape.h.

Constructor & Destructor Documentation

◆ ReshapeChef()

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

Definition at line 25 of file Reshape.h.

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

Member Function Documentation

◆ code()

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

Implements OpChef.

Definition at line 31 of file Reshape.h.

31{ return tflite::BuiltinOperator_RESHAPE; }

◆ type()

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

Implements OpChef.

Definition at line 33 of file Reshape.h.

33{ return tflite::BuiltinOptions_ReshapeOptions; }

◆ value()

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

Implements OpChef.

Definition at line 40 of file Reshape.cpp.

41{
42 auto &operation = (*_operation);
43
44 if (!operation.has_reshape_options())
45 return 0;
46
47 auto options = operation.reshape_options();
48 auto shapes = vector_new_shape(options);
49 // Note: 'CreateVector' should be placed before 'options_builder'
50 // Read flatbuffers.h 'void NotNested()' for more information
51 auto fb_new_shape = fbb.CreateVector(shapes);
52
53 tflite::ReshapeOptionsBuilder options_builder{fbb};
54
55 options_builder.add_new_shape(fb_new_shape);
56
57 return options_builder.Finish().Union();
58}
void Finish(Offset< T > root, const char *file_identifier=nullptr)
Finish serializing a buffer by writing the root offset.
Offset< Vector< T > > CreateVector(const T *v, size_t len)
Serialize an array into a FlatBuffer vector.

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


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