ONE - On-device Neural Engine
Loading...
Searching...
No Matches
tflite2circle Namespace Reference

Data Structures

struct  BufferLink
 
class  CircleModel
 
struct  MetaDataBufferLink
 
class  Offset
 
struct  OperatorCodeLink
 
struct  SubGraphLink
 
class  TFLModel
 

Typedefs

using FlatBufBuilder = std::unique_ptr< flatbuffers::FlatBufferBuilder >
 
using BufferData = std::vector< uint8_t >
 
using MapBufferData = std::map< int32_t, BufferData >
 

Functions

flatbuffers::Offset< circle::AbsOptions > build_circle_AbsOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::AddNOptions > build_circle_AddNOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::AddOptions > build_circle_AddOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ArgMaxOptions > build_circle_ArgMaxOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ArgMinOptions > build_circle_ArgMinOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::BatchMatMulOptions > build_circle_BatchMatMulOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::BatchToSpaceNDOptions > build_circle_BatchToSpaceNDOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::BidirectionalSequenceLSTMOptions > build_circle_BidirectionalSequenceLSTMOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::BroadcastToOptions > build_circle_BroadcastToOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::CastOptions > build_circle_CastOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ConcatenationOptions > build_circle_ConcatenationOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::Conv2DOptions > build_circle_Conv2DOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::CosOptions > build_circle_CosOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::CumsumOptions > build_circle_CumsumOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::DensifyOptions > build_circle_DensifyOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::DepthToSpaceOptions > build_circle_DepthToSpaceOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::DepthwiseConv2DOptions > build_circle_DepthwiseConv2DOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::DequantizeOptions > build_circle_DequantizeOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::DivOptions > build_circle_DivOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::EqualOptions > build_circle_EqualOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ExpandDimsOptions > build_circle_ExpandDimsOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ExpOptions > build_circle_ExpOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::FakeQuantOptions > build_circle_FakeQuantOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::FillOptions > build_circle_FillOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::FloorDivOptions > build_circle_FloorDivOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::FloorModOptions > build_circle_FloorModOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::FullyConnectedOptions > build_circle_FullyConnectedOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::GatherNdOptions > build_circle_GatherNdOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::GatherOptions > build_circle_GatherOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::GeluOptions > build_circle_GeluOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::GreaterEqualOptions > build_circle_GreaterEqualOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::GreaterOptions > build_circle_GreaterOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::IfOptions > build_circle_IfOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::L2NormOptions > build_circle_L2NormOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::LeakyReluOptions > build_circle_LeakyReluOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::LessEqualOptions > build_circle_LessEqualOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::LessOptions > build_circle_LessOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::LocalResponseNormalizationOptions > build_circle_LocalResponseNormalizationOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::LogicalAndOptions > build_circle_LogicalAndOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::LogicalNotOptions > build_circle_LogicalNotOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::LogicalOrOptions > build_circle_LogicalOrOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::LogSoftmaxOptions > build_circle_LogSoftmaxOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::MatrixDiagOptions > build_circle_MatrixDiagOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::MatrixSetDiagOptions > build_circle_MatrixSetDiagOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::MaximumMinimumOptions > build_circle_MaximumMinimumOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::MirrorPadOptions > build_circle_MirrorPadOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::MulOptions > build_circle_MulOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::NegOptions > build_circle_NegOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::NonMaxSuppressionV4Options > build_circle_NonMaxSuppressionV4Options (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::NonMaxSuppressionV5Options > build_circle_NonMaxSuppressionV5Options (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::NotEqualOptions > build_circle_NotEqualOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::OneHotOptions > build_circle_OneHotOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::PackOptions > build_circle_PackOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::PadOptions > build_circle_PadOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::PadV2Options > build_circle_PadV2Options (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::Pool2DOptions > build_circle_Pool2DOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::PowOptions > build_circle_PowOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::RangeOptions > build_circle_RangeOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::RankOptions > build_circle_RankOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::ReducerOptions > build_circle_ReducerOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ReshapeOptions > build_circle_ReshapeOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ResizeBilinearOptions > build_circle_ResizeBilinearOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ResizeNearestNeighborOptions > build_circle_ResizeNearestNeighborOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ReverseSequenceOptions > build_circle_ReverseSequenceOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ReverseV2Options > build_circle_ReverseV2Options (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::ScatterNdOptions > build_circle_ScatterNdOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SegmentSumOptions > build_circle_SegmentSumOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SelectOptions > build_circle_SelectOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SelectV2Options > build_circle_SelectV2Options (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ShapeOptions > build_circle_ShapeOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SliceOptions > build_circle_SliceOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SoftmaxOptions > build_circle_SoftmaxOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SpaceToBatchNDOptions > build_circle_SpaceToBatchNDOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::SpaceToDepthOptions > build_circle_SpaceToDepthOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SparseToDenseOptions > build_circle_SparseToDenseOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SplitOptions > build_circle_SplitOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SplitVOptions > build_circle_SplitVOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SquaredDifferenceOptions > build_circle_SquaredDifferenceOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SquareOptions > build_circle_SquareOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::SqueezeOptions > build_circle_SqueezeOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::StridedSliceOptions > build_circle_StridedSliceOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SubOptions > build_circle_SubOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::SVDFOptions > build_circle_SVDFOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::TileOptions > build_circle_TileOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::TopKV2Options > build_circle_TopKV2Options (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::TransposeConvOptions > build_circle_TransposeConvOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::TransposeOptions > build_circle_TransposeOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::UnidirectionalSequenceLSTMOptions > build_circle_UnidirectionalSequenceLSTMOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::UniqueOptions > build_circle_UniqueOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::UnpackOptions > build_circle_UnpackOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::WhereOptions > build_circle_WhereOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
flatbuffers::Offset< circle::WhileOptions > build_circle_WhileOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 
flatbuffers::Offset< circle::ZerosLikeOptions > build_circle_ZerosLikeOptions (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *)
 
circle::BuiltinOperator get_circle_builtin_code (tflite::BuiltinOperator tfl_bop)
 Returns circle builtin_code according to tflite.
 
int8_t get_circle_builtin_code (int8_t tfl_bop_i8)
 
int32_t get_circle_builtin_code (int32_t tfl_bop_i32)
 
circle::TensorType get_circle_tensortype (tflite::TensorType tfl_tt)
 Returns circle TensorType according to tflite.
 
circle::Padding get_circle_padding (tflite::Padding tfl_p)
 Returns circle Padding enum according to tflite.
 
circle::ActivationFunctionType get_circle_activation_function_type (tflite::ActivationFunctionType tfl_aft)
 Returns circle ActivationFunctionType according to tflite.
 
flatbuffers::Offset< void > get_circle_builtin_options (flatbuffers::FlatBufferBuilder &fb, const tflite::Operator *op)
 Returns circle builtin_options according to tflite.
 
circle::BuiltinOptions get_circle_builtin_options_type (const tflite::Operator *op)
 Returns circle builtin_options_type according to tflite.
 
circle::MirrorPadMode get_circle_mirrorpad_mode (tflite::MirrorPadMode tfl_mode)
 Returns circle MirrorPadMode according to tflite.
 
circle::DimensionType get_circle_dimension_type (tflite::DimensionType tfl_dim_type)
 Returns circle DimensionType according to tflite.
 
flatbuffers::Offset< void > get_circle_sparse_index_vector (flatbuffers::FlatBufferBuilder &fb, const void *values, const tflite::SparseIndexVector &tfl_sparse_index_vector_type)
 Returns circle SparseIndexVector according to tflite.
 
circle::SparseIndexVector get_circle_sparse_index_vector_type (const tflite::SparseIndexVector &tfl_sparse_index_vector_type)
 Returns circle SparseIndexVector type according to tflite.
 

Typedef Documentation

◆ BufferData

using tflite2circle::BufferData = typedef std::vector<uint8_t>

Definition at line 58 of file CircleModel.h.

◆ FlatBufBuilder

Definition at line 32 of file CircleModel.h.

◆ MapBufferData

using tflite2circle::MapBufferData = typedef std::map<int32_t, BufferData>

Definition at line 59 of file CircleModel.h.

Function Documentation

◆ build_circle_AbsOptions()

flatbuffers::Offset< circle::AbsOptions > tflite2circle::build_circle_AbsOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 25 of file AbsOptions.cpp.

27{
28 circle::AbsOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}
void Finish(Offset< T > root, const char *file_identifier=nullptr)
Finish serializing a buffer by writing the root offset.

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_AddNOptions()

flatbuffers::Offset< circle::AddNOptions > tflite2circle::build_circle_AddNOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file AddNOptions.cpp.

27{
28 circle::AddNOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_AddOptions()

flatbuffers::Offset< circle::AddOptions > tflite2circle::build_circle_AddOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file AddOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_AddOptions();
29 assert(tflite_builtin_options);
30 circle::AddOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_fused_activation_function(
32 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
33 return builtin_options_builder.Finish();
34}

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

◆ build_circle_ArgMaxOptions()

flatbuffers::Offset< circle::ArgMaxOptions > tflite2circle::build_circle_ArgMaxOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file ArgMaxOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_ArgMaxOptions();
29 assert(tflite_builtin_options);
30 circle::ArgMaxOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_output_type(
32 get_circle_tensortype(tflite_builtin_options->output_type()));
33 return builtin_options_builder.Finish();
34}

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

◆ build_circle_ArgMinOptions()

flatbuffers::Offset< circle::ArgMinOptions > tflite2circle::build_circle_ArgMinOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file ArgMinOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_ArgMinOptions();
29 assert(tflite_builtin_options);
30 circle::ArgMinOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_output_type(
32 get_circle_tensortype(tflite_builtin_options->output_type()));
33 return builtin_options_builder.Finish();
34}

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

◆ build_circle_BatchMatMulOptions()

flatbuffers::Offset< circle::BatchMatMulOptions > tflite2circle::build_circle_BatchMatMulOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file BatchMatMulOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_BatchMatMulOptions();
29 assert(tflite_builtin_options);
30 circle::BatchMatMulOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_adjoint_lhs(tflite_builtin_options->adj_x());
32 builtin_options_builder.add_adjoint_rhs(tflite_builtin_options->adj_y());
33 return builtin_options_builder.Finish();
34}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_BatchToSpaceNDOptions()

flatbuffers::Offset< circle::BatchToSpaceNDOptions > tflite2circle::build_circle_BatchToSpaceNDOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 26 of file BatchToSpaceNDOptions.cpp.

27{
28 circle::BatchToSpaceNDOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_BidirectionalSequenceLSTMOptions()

flatbuffers::Offset< circle::BidirectionalSequenceLSTMOptions > tflite2circle::build_circle_BidirectionalSequenceLSTMOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file BidirectionalSequenceLSTMOptions.cpp.

28{
29 auto tflite_builtin_options = op->builtin_options_as_BidirectionalSequenceLSTMOptions();
30 circle::BidirectionalSequenceLSTMOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_fused_activation_function(
32 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
33 builtin_options_builder.add_cell_clip(tflite_builtin_options->cell_clip());
34 builtin_options_builder.add_proj_clip(tflite_builtin_options->proj_clip());
35 builtin_options_builder.add_time_major(tflite_builtin_options->time_major());
36 builtin_options_builder.add_merge_outputs(tflite_builtin_options->merge_outputs());
37 builtin_options_builder.add_asymmetric_quantize_inputs(
38 tflite_builtin_options->asymmetric_quantize_inputs());
39 return builtin_options_builder.Finish();
40}

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

◆ build_circle_BroadcastToOptions()

flatbuffers::Offset< circle::BroadcastToOptions > tflite2circle::build_circle_BroadcastToOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file BroadcastToOptions.cpp.

24{
25 auto *tflite_builtin_options = op->builtin_options_as_BroadcastToOptions();
26 assert(tflite_builtin_options);
27 circle::BroadcastToOptionsBuilder builtin_options_builder{fb};
28 return builtin_options_builder.Finish();
29}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_CastOptions()

flatbuffers::Offset< circle::CastOptions > tflite2circle::build_circle_CastOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file CastOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_CastOptions();
29 if (tflite_builtin_options == nullptr)
30 return 0;
31
32 circle::CastOptionsBuilder builtin_options_builder{fb};
33 builtin_options_builder.add_in_data_type(
34 get_circle_tensortype(tflite_builtin_options->in_data_type()));
35 builtin_options_builder.add_out_data_type(
36 get_circle_tensortype(tflite_builtin_options->out_data_type()));
37 return builtin_options_builder.Finish();
38}

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

◆ build_circle_ConcatenationOptions()

flatbuffers::Offset< circle::ConcatenationOptions > tflite2circle::build_circle_ConcatenationOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file ConcatenationOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_ConcatenationOptions();
29 assert(tflite_builtin_options);
30 circle::ConcatenationOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_axis(tflite_builtin_options->axis());
32 builtin_options_builder.add_fused_activation_function(
33 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
34 return builtin_options_builder.Finish();
35}

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

◆ build_circle_Conv2DOptions()

flatbuffers::Offset< circle::Conv2DOptions > tflite2circle::build_circle_Conv2DOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file Conv2DOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_Conv2DOptions();
29 assert(tflite_builtin_options);
30 circle::Conv2DOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_padding(get_circle_padding(tflite_builtin_options->padding()));
32 builtin_options_builder.add_stride_w(tflite_builtin_options->stride_w());
33 builtin_options_builder.add_stride_h(tflite_builtin_options->stride_h());
34 builtin_options_builder.add_fused_activation_function(
35 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
36 builtin_options_builder.add_dilation_w_factor(tflite_builtin_options->dilation_w_factor());
37 builtin_options_builder.add_dilation_h_factor(tflite_builtin_options->dilation_h_factor());
38 return builtin_options_builder.Finish();
39}

References flatbuffers::FlatBufferBuilder::Finish(), get_circle_activation_function_type(), and get_circle_padding().

◆ build_circle_CosOptions()

flatbuffers::Offset< circle::CosOptions > tflite2circle::build_circle_CosOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file CosOptions.cpp.

27{
28 circle::CosOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_CumsumOptions()

flatbuffers::Offset< circle::CumsumOptions > tflite2circle::build_circle_CumsumOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file CumSumOptions.cpp.

26{
27 auto tflite_builtin_options = op->builtin_options_as_CumsumOptions();
28 assert(tflite_builtin_options);
29 circle::CumsumOptionsBuilder cumsum_options_builder{fb};
30 cumsum_options_builder.add_exclusive(tflite_builtin_options->exclusive());
31 cumsum_options_builder.add_reverse(tflite_builtin_options->reverse());
32 return cumsum_options_builder.Finish();
33}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_DensifyOptions()

flatbuffers::Offset< circle::DensifyOptions > tflite2circle::build_circle_DensifyOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 23 of file DensifyOptions.cpp.

24{
25 circle::DensifyOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_DepthToSpaceOptions()

flatbuffers::Offset< circle::DepthToSpaceOptions > tflite2circle::build_circle_DepthToSpaceOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file DepthToSpaceOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_DepthToSpaceOptions();
29 assert(tflite_builtin_options);
30 circle::DepthToSpaceOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_block_size(tflite_builtin_options->block_size());
32 return builtin_options_builder.Finish();
33}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_DepthwiseConv2DOptions()

flatbuffers::Offset< circle::DepthwiseConv2DOptions > tflite2circle::build_circle_DepthwiseConv2DOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file DepthwiseConv2DOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_DepthwiseConv2DOptions();
29 assert(tflite_builtin_options);
30 circle::DepthwiseConv2DOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_padding(get_circle_padding(tflite_builtin_options->padding()));
32 builtin_options_builder.add_stride_w(tflite_builtin_options->stride_w());
33 builtin_options_builder.add_stride_h(tflite_builtin_options->stride_h());
34 builtin_options_builder.add_depth_multiplier(tflite_builtin_options->depth_multiplier());
35 builtin_options_builder.add_fused_activation_function(
36 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
37 builtin_options_builder.add_dilation_w_factor(tflite_builtin_options->dilation_w_factor());
38 builtin_options_builder.add_dilation_h_factor(tflite_builtin_options->dilation_h_factor());
39 return builtin_options_builder.Finish();
40}

References flatbuffers::FlatBufferBuilder::Finish(), get_circle_activation_function_type(), and get_circle_padding().

◆ build_circle_DequantizeOptions()

flatbuffers::Offset< circle::DequantizeOptions > tflite2circle::build_circle_DequantizeOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 24 of file DequantizeOptions.cpp.

25{
26 circle::DequantizeOptionsBuilder builtin_options_builder{fb};
27 return builtin_options_builder.Finish();
28}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_DivOptions()

flatbuffers::Offset< circle::DivOptions > tflite2circle::build_circle_DivOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file DivOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_DivOptions();
29 assert(tflite_builtin_options);
30 circle::DivOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_fused_activation_function(
32 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
33 return builtin_options_builder.Finish();
34}

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

◆ build_circle_EqualOptions()

flatbuffers::Offset< circle::EqualOptions > tflite2circle::build_circle_EqualOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file EqualOptions.cpp.

24{
25 circle::EqualOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_ExpandDimsOptions()

flatbuffers::Offset< circle::ExpandDimsOptions > tflite2circle::build_circle_ExpandDimsOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file ExpandDimsOptions.cpp.

24{
25 circle::ExpandDimsOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_ExpOptions()

flatbuffers::Offset< circle::ExpOptions > tflite2circle::build_circle_ExpOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 25 of file ExpOptions.cpp.

27{
28 circle::ExpOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_FakeQuantOptions()

flatbuffers::Offset< circle::FillOptions > tflite2circle::build_circle_FakeQuantOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file FakeQuantOptions.cpp.

24{
25 auto tflite_builtin_options = op->builtin_options_as_FakeQuantOptions();
26 assert(tflite_builtin_options);
27 circle::FakeQuantOptionsBuilder builtin_options_builder{fb};
28 builtin_options_builder.add_min(tflite_builtin_options->min());
29 builtin_options_builder.add_max(tflite_builtin_options->max());
30 builtin_options_builder.add_num_bits(tflite_builtin_options->num_bits());
31 builtin_options_builder.add_narrow_range(tflite_builtin_options->narrow_range());
32 return builtin_options_builder.Finish();
33}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_FillOptions()

flatbuffers::Offset< circle::FillOptions > tflite2circle::build_circle_FillOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file FillOptions.cpp.

24{
25 circle::FillOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_FloorDivOptions()

flatbuffers::Offset< circle::FloorDivOptions > tflite2circle::build_circle_FloorDivOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 23 of file FloorDivOptions.cpp.

24{
25 circle::FloorDivOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_FloorModOptions()

flatbuffers::Offset< circle::FloorModOptions > tflite2circle::build_circle_FloorModOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file FloorModOptions.cpp.

24{
25 circle::FloorModOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_FullyConnectedOptions()

flatbuffers::Offset< circle::FullyConnectedOptions > tflite2circle::build_circle_FullyConnectedOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file FullyConnectedOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_FullyConnectedOptions();
29 assert(tflite_builtin_options);
30 circle::FullyConnectedOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_fused_activation_function(
32 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
33 // Get FullyConnectedOptionsWeightsFormat
34 auto tflite_weight_format = tflite_builtin_options->weights_format();
35 if (tflite_weight_format == tflite::FullyConnectedOptionsWeightsFormat_DEFAULT)
36 builtin_options_builder.add_weights_format(circle::FullyConnectedOptionsWeightsFormat_DEFAULT);
37 else if (tflite_weight_format == tflite::FullyConnectedOptionsWeightsFormat_SHUFFLED4x16INT8)
38 builtin_options_builder.add_weights_format(
39 circle::FullyConnectedOptionsWeightsFormat_SHUFFLED4x16INT8);
40 builtin_options_builder.add_keep_num_dims(tflite_builtin_options->keep_num_dims());
41 return builtin_options_builder.Finish();
42}

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

◆ build_circle_GatherNdOptions()

flatbuffers::Offset< circle::GatherNdOptions > tflite2circle::build_circle_GatherNdOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 26 of file GatherNdOptions.cpp.

27{
28 circle::GatherNdOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_GatherOptions()

flatbuffers::Offset< circle::GatherOptions > tflite2circle::build_circle_GatherOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file GatherOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_GatherOptions();
29 assert(tflite_builtin_options);
30 circle::GatherOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_axis(tflite_builtin_options->axis());
32 return builtin_options_builder.Finish();
33}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_GeluOptions()

flatbuffers::Offset< circle::GeluOptions > tflite2circle::build_circle_GeluOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file GeluOptions.cpp.

24{
25 auto *tflite_builtin_options = op->builtin_options_as_GeluOptions();
26 assert(tflite_builtin_options);
27 circle::GeluOptionsBuilder builtin_options_builder{fb};
28 builtin_options_builder.add_approximate(tflite_builtin_options->approximate());
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_GreaterEqualOptions()

flatbuffers::Offset< circle::GreaterEqualOptions > tflite2circle::build_circle_GreaterEqualOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file GreaterEqualOptions.cpp.

24{
25 circle::GreaterEqualOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_GreaterOptions()

flatbuffers::Offset< circle::GreaterOptions > tflite2circle::build_circle_GreaterOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file GreaterOptions.cpp.

24{
25 circle::GreaterOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_IfOptions()

flatbuffers::Offset< circle::IfOptions > tflite2circle::build_circle_IfOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file IfOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_IfOptions();
29 assert(tflite_builtin_options);
30 circle::IfOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_then_subgraph_index(tflite_builtin_options->then_subgraph_index());
32 builtin_options_builder.add_else_subgraph_index(tflite_builtin_options->else_subgraph_index());
33 return builtin_options_builder.Finish();
34}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_L2NormOptions()

flatbuffers::Offset< circle::L2NormOptions > tflite2circle::build_circle_L2NormOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file L2NormalizeOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_L2NormOptions();
29 assert(tflite_builtin_options);
30 circle::L2NormOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_fused_activation_function(
32 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
33 return builtin_options_builder.Finish();
34}

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

◆ build_circle_LeakyReluOptions()

flatbuffers::Offset< circle::LeakyReluOptions > tflite2circle::build_circle_LeakyReluOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file LeakyReluOptions.cpp.

24{
25 auto *tflite_builtin_options = op->builtin_options_as_LeakyReluOptions();
26 assert(tflite_builtin_options);
27 circle::LeakyReluOptionsBuilder builtin_options_builder{fb};
28 builtin_options_builder.add_alpha(tflite_builtin_options->alpha());
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_LessEqualOptions()

flatbuffers::Offset< circle::LessEqualOptions > tflite2circle::build_circle_LessEqualOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file LessEqualOptions.cpp.

24{
25 circle::LessEqualOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_LessOptions()

flatbuffers::Offset< circle::LessOptions > tflite2circle::build_circle_LessOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file LessOptions.cpp.

24{
25 circle::LessOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_LocalResponseNormalizationOptions()

flatbuffers::Offset< circle::LocalResponseNormalizationOptions > tflite2circle::build_circle_LocalResponseNormalizationOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file LocalResponseNormalizationOptions.cpp.

28{
29 auto tflite_builtin_options = op->builtin_options_as_LocalResponseNormalizationOptions();
30 assert(tflite_builtin_options);
31 circle::LocalResponseNormalizationOptionsBuilder builtin_options_builder{fb};
32 builtin_options_builder.add_radius(tflite_builtin_options->radius());
33 builtin_options_builder.add_bias(tflite_builtin_options->bias());
34 builtin_options_builder.add_alpha(tflite_builtin_options->alpha());
35 builtin_options_builder.add_beta(tflite_builtin_options->beta());
36 return builtin_options_builder.Finish();
37}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_LogicalAndOptions()

flatbuffers::Offset< circle::LogicalAndOptions > tflite2circle::build_circle_LogicalAndOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file LogicalAndOptions.cpp.

27{
28 circle::LogicalAndOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_LogicalNotOptions()

flatbuffers::Offset< circle::LogicalNotOptions > tflite2circle::build_circle_LogicalNotOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file LogicalNotOptions.cpp.

27{
28 circle::LogicalNotOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_LogicalOrOptions()

flatbuffers::Offset< circle::LogicalOrOptions > tflite2circle::build_circle_LogicalOrOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file LogicalOrOptions.cpp.

27{
28 circle::LogicalOrOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_LogSoftmaxOptions()

flatbuffers::Offset< circle::LogSoftmaxOptions > tflite2circle::build_circle_LogSoftmaxOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file LogSoftmaxOptions.cpp.

27{
28 circle::LogSoftmaxOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_MatrixDiagOptions()

flatbuffers::Offset< circle::MatrixDiagOptions > tflite2circle::build_circle_MatrixDiagOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file MatrixDiagOptions.cpp.

24{
25 circle::MatrixDiagOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_MatrixSetDiagOptions()

flatbuffers::Offset< circle::MatrixSetDiagOptions > tflite2circle::build_circle_MatrixSetDiagOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file MatrixSetDiagOptions.cpp.

24{
25 circle::MatrixSetDiagOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_MaximumMinimumOptions()

flatbuffers::Offset< circle::MaximumMinimumOptions > tflite2circle::build_circle_MaximumMinimumOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file MaximumMinimumOptions.cpp.

27{
28 circle::MaximumMinimumOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_MirrorPadOptions()

flatbuffers::Offset< circle::MirrorPadOptions > tflite2circle::build_circle_MirrorPadOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file MirrorPadOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_MirrorPadOptions();
29 assert(tflite_builtin_options);
30 circle::MirrorPadOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_mode(get_circle_mirrorpad_mode(tflite_builtin_options->mode()));
32 return builtin_options_builder.Finish();
33}

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

◆ build_circle_MulOptions()

flatbuffers::Offset< circle::MulOptions > tflite2circle::build_circle_MulOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file MulOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_MulOptions();
29 assert(tflite_builtin_options);
30 circle::MulOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_fused_activation_function(
32 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
33 return builtin_options_builder.Finish();
34}

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

◆ build_circle_NegOptions()

flatbuffers::Offset< circle::NegOptions > tflite2circle::build_circle_NegOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 25 of file NegOptions.cpp.

27{
28 circle::NegOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_NonMaxSuppressionV4Options()

flatbuffers::Offset< circle::NonMaxSuppressionV4Options > tflite2circle::build_circle_NonMaxSuppressionV4Options ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 23 of file NonMaxSuppressionV4Options.cpp.

25{
26 circle::NonMaxSuppressionV4OptionsBuilder builtin_options_builder{fb};
27 return builtin_options_builder.Finish();
28}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_NonMaxSuppressionV5Options()

flatbuffers::Offset< circle::NonMaxSuppressionV5Options > tflite2circle::build_circle_NonMaxSuppressionV5Options ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 23 of file NonMaxSuppressionV5Options.cpp.

25{
26 circle::NonMaxSuppressionV5OptionsBuilder builtin_options_builder{fb};
27 return builtin_options_builder.Finish();
28}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_NotEqualOptions()

flatbuffers::Offset< circle::NotEqualOptions > tflite2circle::build_circle_NotEqualOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file NotEqualOptions.cpp.

24{
25 circle::NotEqualOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_OneHotOptions()

flatbuffers::Offset< circle::OneHotOptions > tflite2circle::build_circle_OneHotOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file OneHotOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_OneHotOptions();
29 assert(tflite_builtin_options);
30 circle::OneHotOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_axis(tflite_builtin_options->axis());
32 return builtin_options_builder.Finish();
33}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_PackOptions()

flatbuffers::Offset< circle::PackOptions > tflite2circle::build_circle_PackOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file PackOptions.cpp.

26{
27 auto tflite_builtin_options = op->builtin_options_as_PackOptions();
28 assert(tflite_builtin_options);
29 circle::PackOptionsBuilder builtin_options_builder{fb};
30 builtin_options_builder.add_values_count(tflite_builtin_options->values_count());
31 builtin_options_builder.add_axis(tflite_builtin_options->axis());
32 return builtin_options_builder.Finish();
33}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_PadOptions()

flatbuffers::Offset< circle::PadOptions > tflite2circle::build_circle_PadOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 24 of file PadOptions.cpp.

26{
27 circle::PadOptionsBuilder builtin_options_builder{fb};
28 return builtin_options_builder.Finish();
29}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_PadV2Options()

flatbuffers::Offset< circle::PadV2Options > tflite2circle::build_circle_PadV2Options ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file PadV2Options.cpp.

24{
25 circle::PadV2OptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_Pool2DOptions()

flatbuffers::Offset< circle::Pool2DOptions > tflite2circle::build_circle_Pool2DOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file Pool2DOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_Pool2DOptions();
29 assert(tflite_builtin_options);
30 circle::Pool2DOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_padding(get_circle_padding(tflite_builtin_options->padding()));
32 builtin_options_builder.add_stride_w(tflite_builtin_options->stride_w());
33 builtin_options_builder.add_stride_h(tflite_builtin_options->stride_h());
34 builtin_options_builder.add_filter_width(tflite_builtin_options->filter_width());
35 builtin_options_builder.add_filter_height(tflite_builtin_options->filter_height());
36 builtin_options_builder.add_fused_activation_function(
37 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
38 return builtin_options_builder.Finish();
39}

References flatbuffers::FlatBufferBuilder::Finish(), get_circle_activation_function_type(), and get_circle_padding().

◆ build_circle_PowOptions()

flatbuffers::Offset< circle::PowOptions > tflite2circle::build_circle_PowOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file PowOptions.cpp.

27{
28 circle::PowOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_RangeOptions()

flatbuffers::Offset< circle::RangeOptions > tflite2circle::build_circle_RangeOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 26 of file RangeOptions.cpp.

27{
28 circle::RangeOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_RankOptions()

flatbuffers::Offset< circle::RankOptions > tflite2circle::build_circle_RankOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 23 of file RankOptions.cpp.

24{
25 circle::RankOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_ReducerOptions()

flatbuffers::Offset< circle::ReducerOptions > tflite2circle::build_circle_ReducerOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file ReducerOptions.cpp.

26{
27 auto tflite_builtin_options = op->builtin_options_as_ReducerOptions();
28 assert(tflite_builtin_options);
29 circle::ReducerOptionsBuilder reducer_options_builder{fb};
30 reducer_options_builder.add_keep_dims(tflite_builtin_options->keep_dims());
31 return reducer_options_builder.Finish();
32}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_ReshapeOptions()

flatbuffers::Offset< circle::ReshapeOptions > tflite2circle::build_circle_ReshapeOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file ReshapeOptions.cpp.

26{
27 auto tflite_builtin_options = op->builtin_options_as_ReshapeOptions();
28 if (tflite_builtin_options == nullptr)
29 return 0;
30
31 std::vector<int32_t> new_shape_vec{tflite_builtin_options->new_shape()->begin(),
32 tflite_builtin_options->new_shape()->end()};
33 auto new_shape = fb.CreateVector(new_shape_vec);
34 circle::ReshapeOptionsBuilder builtin_options_builder{fb};
35 builtin_options_builder.add_new_shape(new_shape);
36 return builtin_options_builder.Finish();
37}
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().

◆ build_circle_ResizeBilinearOptions()

flatbuffers::Offset< circle::ResizeBilinearOptions > tflite2circle::build_circle_ResizeBilinearOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file ResizeBilinearOptions.cpp.

26{
27 auto tflite_builtin_options = op->builtin_options_as_ResizeBilinearOptions();
28 assert(tflite_builtin_options);
29
30 circle::ResizeBilinearOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_align_corners(tflite_builtin_options->align_corners());
32 builtin_options_builder.add_half_pixel_centers(tflite_builtin_options->half_pixel_centers());
33 return builtin_options_builder.Finish();
34}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_ResizeNearestNeighborOptions()

flatbuffers::Offset< circle::ResizeNearestNeighborOptions > tflite2circle::build_circle_ResizeNearestNeighborOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file ResizeNearestNeighborOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_ResizeNearestNeighborOptions();
29 assert(tflite_builtin_options);
30
31 circle::ResizeNearestNeighborOptionsBuilder builtin_options_builder{fb};
32 builtin_options_builder.add_align_corners(tflite_builtin_options->align_corners());
33 return builtin_options_builder.Finish();
34}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_ReverseSequenceOptions()

flatbuffers::Offset< circle::ReverseSequenceOptions > tflite2circle::build_circle_ReverseSequenceOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file ReverseSequenceOptions.cpp.

24{
25 auto tflite_builtin_options = op->builtin_options_as_ReverseSequenceOptions();
26 assert(tflite_builtin_options);
27 circle::ReverseSequenceOptionsBuilder builtin_options_builder{fb};
28 builtin_options_builder.add_seq_dim(tflite_builtin_options->seq_dim());
29 builtin_options_builder.add_batch_dim(tflite_builtin_options->batch_dim());
30 return builtin_options_builder.Finish();
31}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_ReverseV2Options()

flatbuffers::Offset< circle::ReverseV2Options > tflite2circle::build_circle_ReverseV2Options ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 23 of file ReverseV2Options.cpp.

24{
25 circle::ReverseV2OptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_ScatterNdOptions()

flatbuffers::Offset< circle::ScatterNdOptions > tflite2circle::build_circle_ScatterNdOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file ScatterNdOptions.cpp.

27{
28 circle::ScatterNdOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SegmentSumOptions()

flatbuffers::Offset< circle::SegmentSumOptions > tflite2circle::build_circle_SegmentSumOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file SegmentSumOptions.cpp.

24{
25 circle::SegmentSumOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SelectOptions()

flatbuffers::Offset< circle::SelectOptions > tflite2circle::build_circle_SelectOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file SelectOptions.cpp.

24{
25 circle::SelectOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SelectV2Options()

flatbuffers::Offset< circle::SelectV2Options > tflite2circle::build_circle_SelectV2Options ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file SelectV2Options.cpp.

24{
25 circle::SelectV2OptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_ShapeOptions()

flatbuffers::Offset< circle::ShapeOptions > tflite2circle::build_circle_ShapeOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file ShapeOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_ShapeOptions();
29 assert(tflite_builtin_options);
30 circle::ShapeOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_out_type(get_circle_tensortype(tflite_builtin_options->out_type()));
32 return builtin_options_builder.Finish();
33}

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

◆ build_circle_SliceOptions()

flatbuffers::Offset< circle::SliceOptions > tflite2circle::build_circle_SliceOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file SliceOptions.cpp.

24{
25 circle::SliceOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SoftmaxOptions()

flatbuffers::Offset< circle::SoftmaxOptions > tflite2circle::build_circle_SoftmaxOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file SoftmaxOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_SoftmaxOptions();
29 assert(tflite_builtin_options);
30 circle::SoftmaxOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_beta(tflite_builtin_options->beta());
32 return builtin_options_builder.Finish();
33}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SpaceToBatchNDOptions()

flatbuffers::Offset< circle::SpaceToBatchNDOptions > tflite2circle::build_circle_SpaceToBatchNDOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 26 of file SpaceToBatchNDOptions.cpp.

27{
28 circle::SpaceToBatchNDOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SpaceToDepthOptions()

flatbuffers::Offset< circle::SpaceToDepthOptions > tflite2circle::build_circle_SpaceToDepthOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file SpaceToDepthOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_SpaceToDepthOptions();
29 assert(tflite_builtin_options);
30 circle::SpaceToDepthOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_block_size(tflite_builtin_options->block_size());
32 return builtin_options_builder.Finish();
33}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SparseToDenseOptions()

flatbuffers::Offset< circle::SparseToDenseOptions > tflite2circle::build_circle_SparseToDenseOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file SparseToDenseOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_SparseToDenseOptions();
29 assert(tflite_builtin_options);
30 circle::SparseToDenseOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_validate_indices(tflite_builtin_options->validate_indices());
32 return builtin_options_builder.Finish();
33}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SplitOptions()

flatbuffers::Offset< circle::SplitOptions > tflite2circle::build_circle_SplitOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file SplitOptions.cpp.

26{
27 auto tflite_builtin_options = op->builtin_options_as_SplitOptions();
28 assert(tflite_builtin_options);
29 circle::SplitOptionsBuilder builtin_options_builder{fb};
30 builtin_options_builder.add_num_splits(tflite_builtin_options->num_splits());
31 return builtin_options_builder.Finish();
32}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SplitVOptions()

flatbuffers::Offset< circle::SplitVOptions > tflite2circle::build_circle_SplitVOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file SplitVOptions.cpp.

26{
27 auto tflite_builtin_options = op->builtin_options_as_SplitVOptions();
28 assert(tflite_builtin_options);
29 circle::SplitVOptionsBuilder builtin_options_builder{fb};
30 builtin_options_builder.add_num_splits(tflite_builtin_options->num_splits());
31 return builtin_options_builder.Finish();
32}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SquaredDifferenceOptions()

flatbuffers::Offset< circle::SquaredDifferenceOptions > tflite2circle::build_circle_SquaredDifferenceOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 23 of file SquaredDifferenceOptions.cpp.

25{
26 circle::SquaredDifferenceOptionsBuilder builtin_options_builder{fb};
27 return builtin_options_builder.Finish();
28}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SquareOptions()

flatbuffers::Offset< circle::SquareOptions > tflite2circle::build_circle_SquareOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 23 of file SquareOptions.cpp.

24{
25 circle::SquareOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SqueezeOptions()

flatbuffers::Offset< circle::SqueezeOptions > tflite2circle::build_circle_SqueezeOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file SqueezeOptions.cpp.

26{
27 auto tflite_builtin_options = op->builtin_options_as_SqueezeOptions();
28 assert(tflite_builtin_options);
29 std::vector<int32_t> squeeze_dims_vec{tflite_builtin_options->squeeze_dims()->begin(),
30 tflite_builtin_options->squeeze_dims()->end()};
31 auto squeeze_dims = fb.CreateVector(squeeze_dims_vec);
32 circle::SqueezeOptionsBuilder builtin_options_builder{fb};
33 builtin_options_builder.add_squeeze_dims(squeeze_dims);
34 return builtin_options_builder.Finish();
35}

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

◆ build_circle_StridedSliceOptions()

flatbuffers::Offset< circle::StridedSliceOptions > tflite2circle::build_circle_StridedSliceOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file StridedSliceOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_StridedSliceOptions();
29 assert(tflite_builtin_options);
30 circle::StridedSliceOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_begin_mask(tflite_builtin_options->begin_mask());
32 builtin_options_builder.add_end_mask(tflite_builtin_options->end_mask());
33 builtin_options_builder.add_ellipsis_mask(tflite_builtin_options->ellipsis_mask());
34 builtin_options_builder.add_new_axis_mask(tflite_builtin_options->new_axis_mask());
35 builtin_options_builder.add_shrink_axis_mask(tflite_builtin_options->shrink_axis_mask());
36 return builtin_options_builder.Finish();
37}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_SubOptions()

flatbuffers::Offset< circle::SubOptions > tflite2circle::build_circle_SubOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file SubOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_SubOptions();
29 assert(tflite_builtin_options);
30 circle::SubOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_fused_activation_function(
32 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
33 return builtin_options_builder.Finish();
34}

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

◆ build_circle_SVDFOptions()

flatbuffers::Offset< circle::SVDFOptions > tflite2circle::build_circle_SVDFOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file SVDFOptions.cpp.

27{
28 auto *tflite_builtin_options = op->builtin_options_as_SVDFOptions();
29 assert(tflite_builtin_options);
30
31 circle::SVDFOptionsBuilder builtin_options_builder{fb};
32 builtin_options_builder.add_rank(tflite_builtin_options->rank());
33 builtin_options_builder.add_asymmetric_quantize_inputs(
34 tflite_builtin_options->asymmetric_quantize_inputs());
35 builtin_options_builder.add_fused_activation_function(
36 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
37
38 return builtin_options_builder.Finish();
39}

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

◆ build_circle_TileOptions()

flatbuffers::Offset< circle::TileOptions > tflite2circle::build_circle_TileOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file TileOptions.cpp.

26{
27 circle::TileOptionsBuilder builtin_options_builder{fb};
28 return builtin_options_builder.Finish();
29}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_TopKV2Options()

flatbuffers::Offset< circle::TopKV2Options > tflite2circle::build_circle_TopKV2Options ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file TopKV2Options.cpp.

26{
27 circle::TopKV2OptionsBuilder builtin_options_builder{fb};
28 return builtin_options_builder.Finish();
29}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_TransposeConvOptions()

flatbuffers::Offset< circle::TransposeConvOptions > tflite2circle::build_circle_TransposeConvOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file TransposeConvOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_TransposeConvOptions();
29 assert(tflite_builtin_options);
30 circle::TransposeConvOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_padding(get_circle_padding(tflite_builtin_options->padding()));
32 builtin_options_builder.add_stride_w(tflite_builtin_options->stride_w());
33 builtin_options_builder.add_stride_h(tflite_builtin_options->stride_h());
34 builtin_options_builder.add_fused_activation_function(
35 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
36 return builtin_options_builder.Finish();
37}

References flatbuffers::FlatBufferBuilder::Finish(), get_circle_activation_function_type(), and get_circle_padding().

◆ build_circle_TransposeOptions()

flatbuffers::Offset< circle::TransposeOptions > tflite2circle::build_circle_TransposeOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 25 of file TransposeOptions.cpp.

26{
27 circle::TransposeOptionsBuilder builtin_options_builder{fb};
28 return builtin_options_builder.Finish();
29}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_UnidirectionalSequenceLSTMOptions()

flatbuffers::Offset< circle::UnidirectionalSequenceLSTMOptions > tflite2circle::build_circle_UnidirectionalSequenceLSTMOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file UnidirectionalSequenceLSTMOptions.cpp.

28{
29 auto tflite_builtin_options = op->builtin_options_as_UnidirectionalSequenceLSTMOptions();
30 circle::UnidirectionalSequenceLSTMOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_fused_activation_function(
32 get_circle_activation_function_type(tflite_builtin_options->fused_activation_function()));
33 builtin_options_builder.add_cell_clip(tflite_builtin_options->cell_clip());
34 builtin_options_builder.add_proj_clip(tflite_builtin_options->proj_clip());
35 builtin_options_builder.add_time_major(tflite_builtin_options->time_major());
36 builtin_options_builder.add_asymmetric_quantize_inputs(
37 tflite_builtin_options->asymmetric_quantize_inputs());
38 return builtin_options_builder.Finish();
39}

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

◆ build_circle_UniqueOptions()

flatbuffers::Offset< circle::UniqueOptions > tflite2circle::build_circle_UniqueOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file UniqueOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_UniqueOptions();
29 assert(tflite_builtin_options);
30 circle::UniqueOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_idx_out_type(
32 get_circle_tensortype(tflite_builtin_options->idx_out_type()));
33 return builtin_options_builder.Finish();
34}

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

◆ build_circle_UnpackOptions()

flatbuffers::Offset< circle::UnpackOptions > tflite2circle::build_circle_UnpackOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file UnpackOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_UnpackOptions();
29 assert(tflite_builtin_options);
30 circle::UnpackOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_num(tflite_builtin_options->num());
32 builtin_options_builder.add_axis(tflite_builtin_options->axis());
33 return builtin_options_builder.Finish();
34}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_WhereOptions()

flatbuffers::Offset< circle::WhereOptions > tflite2circle::build_circle_WhereOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 23 of file WhereOptions.cpp.

24{
25 circle::WhereOptionsBuilder builtin_options_builder{fb};
26 return builtin_options_builder.Finish();
27}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_WhileOptions()

flatbuffers::Offset< circle::WhileOptions > tflite2circle::build_circle_WhileOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Definition at line 26 of file WhileOptions.cpp.

27{
28 auto tflite_builtin_options = op->builtin_options_as_WhileOptions();
29 assert(tflite_builtin_options);
30 circle::WhileOptionsBuilder builtin_options_builder{fb};
31 builtin_options_builder.add_cond_subgraph_index(tflite_builtin_options->cond_subgraph_index());
32 builtin_options_builder.add_body_subgraph_index(tflite_builtin_options->body_subgraph_index());
33 return builtin_options_builder.Finish();
34}

References flatbuffers::FlatBufferBuilder::Finish().

◆ build_circle_ZerosLikeOptions()

flatbuffers::Offset< circle::ZerosLikeOptions > tflite2circle::build_circle_ZerosLikeOptions ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *   
)

Definition at line 26 of file ZerosLikeOptions.cpp.

27{
28 circle::ZerosLikeOptionsBuilder builtin_options_builder{fb};
29 return builtin_options_builder.Finish();
30}

References flatbuffers::FlatBufferBuilder::Finish().

◆ get_circle_activation_function_type()

circle::ActivationFunctionType tflite2circle::get_circle_activation_function_type ( tflite::ActivationFunctionType  tfl_aft)

Returns circle ActivationFunctionType according to tflite.

Note
You can see a list of currently supported ActivationFunctionType in TFLActivationFunctionType.lst file.

Definition at line 96 of file DataLookup.cpp.

97{
98 switch (tfl_aft)
99 {
100#define TFL_ACTIVATION_FUNCTION(TYPE) \
101 case tflite::ActivationFunctionType_##TYPE: \
102 return circle::ActivationFunctionType_##TYPE;
103#include "TFLActivationFunctionType.lst"
104#undef TFL_ACTIVATION_FUNCTION
105 default:
106 throw std::runtime_error("tflite2circle: wrong activation function type.");
107 }
108}

Referenced by build_circle_AddOptions(), build_circle_BidirectionalSequenceLSTMOptions(), build_circle_ConcatenationOptions(), build_circle_Conv2DOptions(), build_circle_DepthwiseConv2DOptions(), build_circle_DivOptions(), build_circle_FullyConnectedOptions(), build_circle_L2NormOptions(), build_circle_MulOptions(), build_circle_Pool2DOptions(), build_circle_SubOptions(), build_circle_SVDFOptions(), build_circle_TransposeConvOptions(), and build_circle_UnidirectionalSequenceLSTMOptions().

◆ get_circle_builtin_code() [1/3]

int32_t tflite2circle::get_circle_builtin_code ( int32_t  tfl_bop_i32)

Definition at line 46 of file DataLookup.cpp.

47{
48 tflite::BuiltinOperator tfl_bop = static_cast<tflite::BuiltinOperator>(tfl_bop_i32);
49
50 switch (tfl_bop)
51 {
52#define TFL_OPERATOR(OP) \
53 case tflite::BuiltinOperator_##OP: \
54 return static_cast<int32_t>(circle::BuiltinOperator_##OP);
55#include "TFLOperator.lst"
56#undef TFL_OPERATOR
57 case tflite::BuiltinOperator_PLACEHOLDER_FOR_GREATER_OP_CODES:
58 return static_cast<int32_t>(circle::BuiltinOperator_PLACEHOLDER_FOR_GREATER_OP_CODES);
59 default:
60 {
61 std::string msg = "tflite2circle: Unsupported op ";
62 msg = msg + tflite::EnumNameBuiltinOperator(tfl_bop);
63 throw std::runtime_error(msg.c_str());
64 }
65 }
66}

◆ get_circle_builtin_code() [2/3]

int8_t tflite2circle::get_circle_builtin_code ( int8_t  tfl_bop_i8)

Definition at line 41 of file DataLookup.cpp.

42{
43 return get_circle_builtin_code(static_cast<int32_t>(tfl_bop_i8));
44}
circle::BuiltinOperator get_circle_builtin_code(tflite::BuiltinOperator tfl_bop)
Returns circle builtin_code according to tflite.

References get_circle_builtin_code().

◆ get_circle_builtin_code() [3/3]

circle::BuiltinOperator tflite2circle::get_circle_builtin_code ( tflite::BuiltinOperator  tfl_bop)

Returns circle builtin_code according to tflite.

Note
You can see a list of currently supported BuiltinOperator in TFLOperator.lst file.

Definition at line 23 of file DataLookup.cpp.

24{
25 switch (tfl_bop)
26 {
27#define TFL_OPERATOR(OP) \
28 case tflite::BuiltinOperator_##OP: \
29 return circle::BuiltinOperator_##OP;
30#include "TFLOperator.lst"
31#undef TFL_OPERATOR
32 default:
33 {
34 std::string msg = "tflite2circle: Unsupported op ";
35 msg = msg + tflite::EnumNameBuiltinOperator(tfl_bop);
36 throw std::runtime_error(msg.c_str());
37 }
38 }
39}

Referenced by tflite2circle::Offset< T >::build(), and get_circle_builtin_code().

◆ get_circle_builtin_options()

flatbuffers::Offset< void > tflite2circle::get_circle_builtin_options ( flatbuffers::FlatBufferBuilder fb,
const tflite::Operator *  op 
)

Returns circle builtin_options according to tflite.

Note
You can see a list of currently supported BuiltinOptions in TFLBuiltinOptions.lst file.

This function calls the build_circle_#BuiltinOptions internally(e.g. build_circle_AbsOptions, build_circle_AddOptions, etc.), so refer to it for a more detailed implementation.

Definition at line 110 of file DataLookup.cpp.

112{
113 auto tflite_builtin_options_type = op->builtin_options_type();
114 switch (tflite_builtin_options_type)
115 {
116 case tflite::BuiltinOptions_NONE:
118#define TFL_BUILTIN_OPTIONS(TYPE) \
119 case tflite::BuiltinOptions_##TYPE: \
120 return build_circle_##TYPE(fb, op).Union();
121#include "TFLBuiltinOptions.lst"
122#undef TFL_BUILTIN_OPTIONS
123 default:
124 throw std::runtime_error("tflite2circle: wrong builtin options type.");
125 }
126}

Referenced by tflite2circle::Offset< T >::build().

◆ get_circle_builtin_options_type()

circle::BuiltinOptions tflite2circle::get_circle_builtin_options_type ( const tflite::Operator *  op)

Returns circle builtin_options_type according to tflite.

Note
You can see a list of currently supported BuiltinOptions in TFLBuiltinOptions.lst file.

Definition at line 128 of file DataLookup.cpp.

129{
130 switch (op->builtin_options_type())
131 {
132 case tflite::BuiltinOptions_NONE:
133 return circle::BuiltinOptions_NONE;
134#define TFL_BUILTIN_OPTIONS(TYPE) \
135 case tflite::BuiltinOptions_##TYPE: \
136 return circle::BuiltinOptions_##TYPE;
137#include "TFLBuiltinOptions.lst"
138#undef TFL_BUILTIN_OPTIONS
139 default:
140 throw std::runtime_error("tflite2circle: wrong builtin options type.");
141 }
142}

Referenced by tflite2circle::Offset< T >::build().

◆ get_circle_dimension_type()

circle::DimensionType tflite2circle::get_circle_dimension_type ( tflite::DimensionType  tfl_dim_type)

Returns circle DimensionType according to tflite.

Definition at line 157 of file DataLookup.cpp.

158{
159 switch (tfl_dim_type)
160 {
161 case tflite::DimensionType_DENSE:
162 return circle::DimensionType_DENSE;
163 case tflite::DimensionType_SPARSE_CSR:
164 return circle::DimensionType_SPARSE_CSR;
165 default:
166 throw std::runtime_error("tflite2circle: wrong dimension type.");
167 }
168}

Referenced by tflite2circle::Offset< T >::build().

◆ get_circle_mirrorpad_mode()

circle::MirrorPadMode tflite2circle::get_circle_mirrorpad_mode ( tflite::MirrorPadMode  tfl_mode)

Returns circle MirrorPadMode according to tflite.

Definition at line 144 of file DataLookup.cpp.

145{
146 switch (tfl_mode)
147 {
148 case tflite::MirrorPadMode_REFLECT:
149 return circle::MirrorPadMode_REFLECT;
150 case tflite::MirrorPadMode_SYMMETRIC:
151 return circle::MirrorPadMode_SYMMETRIC;
152 default:
153 throw std::runtime_error("tflite2circle: wrong mirrorpad mode.");
154 }
155}

Referenced by build_circle_MirrorPadOptions().

◆ get_circle_padding()

circle::Padding tflite2circle::get_circle_padding ( tflite::Padding  tfl_p)

Returns circle Padding enum according to tflite.

Definition at line 82 of file DataLookup.cpp.

83{
84 switch (tfl_p)
85 {
86 case tflite::Padding_SAME:
87 return circle::Padding_SAME;
88 case tflite::Padding_VALID:
89 return circle::Padding_VALID;
90 default:
91 throw std::runtime_error("tflite2circle: wrong padding");
92 }
93}

Referenced by build_circle_Conv2DOptions(), build_circle_DepthwiseConv2DOptions(), build_circle_Pool2DOptions(), and build_circle_TransposeConvOptions().

◆ get_circle_sparse_index_vector()

flatbuffers::Offset< void > tflite2circle::get_circle_sparse_index_vector ( flatbuffers::FlatBufferBuilder fb,
const void *  v_array,
const tflite::SparseIndexVector &  tfl_sparse_index_vector_type 
)

Returns circle SparseIndexVector according to tflite.

Definition at line 171 of file DataLookup.cpp.

173{
174 switch (tfl_sparse_index_vector_type)
175 {
176 case tflite::SparseIndexVector_NONE:
178 case tflite::SparseIndexVector_Int32Vector:
179 {
180 const tflite::Int32Vector *i32_array = static_cast<const tflite::Int32Vector *>(v_array);
181 auto values_vec_int32 =
182 std::vector<int32_t>{i32_array->values()->begin(), i32_array->values()->end()};
183 auto values_int32 = fb.CreateVector(values_vec_int32);
184 circle::Int32VectorBuilder int32_vector_builder{fb};
185 int32_vector_builder.add_values(values_int32);
186 return int32_vector_builder.Finish().Union();
187 }
188 case tflite::SparseIndexVector_Uint16Vector:
189 {
190 const tflite::Uint16Vector *u16_array = static_cast<const tflite::Uint16Vector *>(v_array);
191 auto values_vec_uint16 =
192 std::vector<uint16_t>{u16_array->values()->begin(), u16_array->values()->end()};
193 auto values_uint16 = fb.CreateVector(values_vec_uint16);
194 circle::Uint16VectorBuilder uint16_vector_builder{fb};
195 uint16_vector_builder.add_values(values_uint16);
196 return uint16_vector_builder.Finish().Union();
197 }
198 case tflite::SparseIndexVector_Uint8Vector:
199 {
200 const tflite::Uint8Vector *u8_array = static_cast<const tflite::Uint8Vector *>(v_array);
201 auto values_vec_uint8 =
202 std::vector<uint8_t>{u8_array->values()->begin(), u8_array->values()->end()};
203 auto values_uint8 = fb.CreateVector(values_vec_uint8);
204 circle::Uint8VectorBuilder uint8_vector_builder{fb};
205 uint8_vector_builder.add_values(values_uint8);
206 return uint8_vector_builder.Finish().Union();
207 }
208 default:
209 throw std::runtime_error("tflite2circle: wrong SparseIndexVector type.");
210 }
211}

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

Referenced by tflite2circle::Offset< T >::build().

◆ get_circle_sparse_index_vector_type()

circle::SparseIndexVector tflite2circle::get_circle_sparse_index_vector_type ( const tflite::SparseIndexVector &  tfl_sparse_index_vector_type)

Returns circle SparseIndexVector type according to tflite.

Definition at line 214 of file DataLookup.cpp.

215{
216 switch (tfl_sparse_index_vector_type)
217 {
218 case tflite::SparseIndexVector_NONE:
219 return circle::SparseIndexVector_NONE;
220 case tflite::SparseIndexVector_Int32Vector:
221 return circle::SparseIndexVector_Int32Vector;
222 case tflite::SparseIndexVector_Uint16Vector:
223 return circle::SparseIndexVector_Uint16Vector;
224 case tflite::SparseIndexVector_Uint8Vector:
225 return circle::SparseIndexVector_Uint8Vector;
226 default:
227 throw std::runtime_error("tflite2circle: wrong SparseIndexVector type.");
228 }
229}

Referenced by tflite2circle::Offset< T >::build().

◆ get_circle_tensortype()

circle::TensorType tflite2circle::get_circle_tensortype ( tflite::TensorType  tfl_tt)

Returns circle TensorType according to tflite.

Note
You can see a list of currently supported TensorType in TFLTensorType.lst file.

Definition at line 68 of file DataLookup.cpp.

69{
70 switch (tfl_tt)
71 {
72#define TFL_TENSORTYPE(TENSORTYPE) \
73 case tflite::TensorType_##TENSORTYPE: \
74 return circle::TensorType_##TENSORTYPE;
75#include "TFLTensorType.lst"
76#undef TFL_TENSORTYPE
77 default:
78 throw std::runtime_error("tflite2circle: wrong tensor type");
79 }
80}

Referenced by tflite2circle::Offset< T >::build(), build_circle_ArgMaxOptions(), build_circle_ArgMinOptions(), build_circle_CastOptions(), build_circle_ShapeOptions(), and build_circle_UniqueOptions().