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

#include <BroadcastTo.h>

Collaboration diagram for BroadcastToChef:

Public Member Functions

 BroadcastToChef (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
 
 BroadcastToChef (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 ~OpChef ()=default
 

Detailed Description

Definition at line 22 of file BroadcastTo.h.

Constructor & Destructor Documentation

◆ BroadcastToChef() [1/2]

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

Definition at line 25 of file BroadcastTo.h.

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

◆ BroadcastToChef() [2/2]

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

Definition at line 25 of file BroadcastTo.h.

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

Member Function Documentation

◆ code() [1/2]

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

Implements OpChef.

Definition at line 31 of file BroadcastTo.h.

31{ return tflite::BuiltinOperator_CUSTOM; }

◆ code() [2/2]

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

Implements OpChef.

Definition at line 31 of file BroadcastTo.h.

31{ return tflite::BuiltinOperator_BROADCAST_TO; }

◆ custom_value()

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

REGISTER_OP("BroadcastTo") .Input("input: T") .Input("shape: Tidx") .Output("output: T") .Attr("T: type") .Attr("Tidx: {int32, int64} = DT_INT32") .SetShapeFn([](InferenceContext* c)

Reimplemented from OpChef.

Definition at line 29 of file BroadcastTo.cpp.

30{
31 auto &operation = (*_operation);
32
33 check_custom_op_value(operation, "BroadcastTo");
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("T", tflite::TensorType_FLOAT32);
50 flex_buffers->Int("Tidx", tflite::TensorType_INT32);
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() [1/2]

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

Implements OpChef.

Definition at line 33 of file BroadcastTo.h.

33{ return tflite::BuiltinOptions_NONE; }

◆ type() [2/2]

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

Implements OpChef.

Definition at line 33 of file BroadcastTo.h.

34 {
35 return tflite::BuiltinOptions_BroadcastToOptions;
36 }

◆ value() [1/2]

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

Implements OpChef.

Definition at line 23 of file BroadcastTo.cpp.

◆ value() [2/2]

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

Implements OpChef.


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