diff --git a/ethosu/regor/tflite/tflite_schema_generated.hpp b/ethosu/regor/tflite/tflite_schema_generated.hpp index f7f7b28f720fded69bab3c3dc285beba72b0eb96..d5500a7b553dd557e79351581b04557e97ed183d 100644 --- a/ethosu/regor/tflite/tflite_schema_generated.hpp +++ b/ethosu/regor/tflite/tflite_schema_generated.hpp @@ -1,8 +1,8 @@ // automatically generated by the FlatBuffers compiler, do not modify // // To reproduce: -// flatc version 23.12.23 -// schema.fbs @v2.17.1 +// flatc version 24.12.23 +// schema.fbs @v2.18.0 // flatc --cpp --scoped-enums --reflect-names --gen-mutable schema.fbs // sed -i 's/ARG_MAX/ARGMAX/g' tflite_schema_generated.hpp @@ -492,6 +492,9 @@ struct OperatorCodeBuilder; struct StableHLOCompositeOptions; struct StableHLOCompositeOptionsBuilder; +struct StablehloShiftLeftOptions; +struct StablehloShiftLeftOptionsBuilder; + struct Operator; struct OperatorBuilder; @@ -827,6 +830,8 @@ inline const ::flatbuffers::TypeTable *OperatorCodeTypeTable(); inline const ::flatbuffers::TypeTable *StableHLOCompositeOptionsTypeTable(); +inline const ::flatbuffers::TypeTable *StablehloShiftLeftOptionsTypeTable(); + inline const ::flatbuffers::TypeTable *OperatorTypeTable(); inline const ::flatbuffers::TypeTable *SubGraphTypeTable(); @@ -1256,11 +1261,13 @@ enum class BuiltinOperator : int32_t { STABLEHLO_RNG_BIT_GENERATOR = 204, REDUCE_WINDOW = 205, STABLEHLO_COMPOSITE = 206, + STABLEHLO_SHIFT_LEFT = 207, + STABLEHLO_CBRT = 208, MIN = ADD, - MAX = STABLEHLO_COMPOSITE + MAX = STABLEHLO_CBRT }; -inline const BuiltinOperator (&EnumValuesBuiltinOperator())[207] { +inline const BuiltinOperator (&EnumValuesBuiltinOperator())[209] { static const BuiltinOperator values[] = { BuiltinOperator::ADD, BuiltinOperator::AVERAGE_POOL_2D, @@ -1468,13 +1475,15 @@ inline const BuiltinOperator (&EnumValuesBuiltinOperator())[207] { BuiltinOperator::DILATE, BuiltinOperator::STABLEHLO_RNG_BIT_GENERATOR, BuiltinOperator::REDUCE_WINDOW, - BuiltinOperator::STABLEHLO_COMPOSITE + BuiltinOperator::STABLEHLO_COMPOSITE, + BuiltinOperator::STABLEHLO_SHIFT_LEFT, + BuiltinOperator::STABLEHLO_CBRT }; return values; } inline const char * const *EnumNamesBuiltinOperator() { - static const char * const names[208] = { + static const char * const names[210] = { "ADD", "AVERAGE_POOL_2D", "CONCATENATION", @@ -1682,13 +1691,15 @@ inline const char * const *EnumNamesBuiltinOperator() { "STABLEHLO_RNG_BIT_GENERATOR", "REDUCE_WINDOW", "STABLEHLO_COMPOSITE", + "STABLEHLO_SHIFT_LEFT", + "STABLEHLO_CBRT", nullptr }; return names; } inline const char *EnumNameBuiltinOperator(BuiltinOperator e) { - if (::flatbuffers::IsOutRange(e, BuiltinOperator::ADD, BuiltinOperator::STABLEHLO_COMPOSITE)) return ""; + if (::flatbuffers::IsOutRange(e, BuiltinOperator::ADD, BuiltinOperator::STABLEHLO_CBRT)) return ""; const size_t index = static_cast(e); return EnumNamesBuiltinOperator()[index]; } @@ -2632,11 +2643,12 @@ enum class BuiltinOptions2 : uint8_t { StablehloRngBitGeneratorOptions = 19, ReduceWindowOptions = 20, StableHLOCompositeOptions = 21, + StablehloShiftLeftOptions = 22, MIN = NONE, - MAX = StableHLOCompositeOptions + MAX = StablehloShiftLeftOptions }; -inline const BuiltinOptions2 (&EnumValuesBuiltinOptions2())[22] { +inline const BuiltinOptions2 (&EnumValuesBuiltinOptions2())[23] { static const BuiltinOptions2 values[] = { BuiltinOptions2::NONE, BuiltinOptions2::StablehloConcatenateOptions, @@ -2659,13 +2671,14 @@ inline const BuiltinOptions2 (&EnumValuesBuiltinOptions2())[22] { BuiltinOptions2::DilateOptions, BuiltinOptions2::StablehloRngBitGeneratorOptions, BuiltinOptions2::ReduceWindowOptions, - BuiltinOptions2::StableHLOCompositeOptions + BuiltinOptions2::StableHLOCompositeOptions, + BuiltinOptions2::StablehloShiftLeftOptions }; return values; } inline const char * const *EnumNamesBuiltinOptions2() { - static const char * const names[23] = { + static const char * const names[24] = { "NONE", "StablehloConcatenateOptions", "StablehloBroadcastInDimOptions", @@ -2688,13 +2701,14 @@ inline const char * const *EnumNamesBuiltinOptions2() { "StablehloRngBitGeneratorOptions", "ReduceWindowOptions", "StableHLOCompositeOptions", + "StablehloShiftLeftOptions", nullptr }; return names; } inline const char *EnumNameBuiltinOptions2(BuiltinOptions2 e) { - if (::flatbuffers::IsOutRange(e, BuiltinOptions2::NONE, BuiltinOptions2::StableHLOCompositeOptions)) return ""; + if (::flatbuffers::IsOutRange(e, BuiltinOptions2::NONE, BuiltinOptions2::StablehloShiftLeftOptions)) return ""; const size_t index = static_cast(e); return EnumNamesBuiltinOptions2()[index]; } @@ -2787,6 +2801,10 @@ template<> struct BuiltinOptions2Traits { static const BuiltinOptions2 enum_value = BuiltinOptions2::StableHLOCompositeOptions; }; +template<> struct BuiltinOptions2Traits { + static const BuiltinOptions2 enum_value = BuiltinOptions2::StablehloShiftLeftOptions; +}; + bool VerifyBuiltinOptions2(::flatbuffers::Verifier &verifier, const void *obj, BuiltinOptions2 type); bool VerifyBuiltinOptions2Vector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset> *values, const ::flatbuffers::Vector *types); @@ -12359,6 +12377,38 @@ inline ::flatbuffers::Offset CreateStableHLOComposite version); } +struct StablehloShiftLeftOptions FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { + typedef StablehloShiftLeftOptionsBuilder Builder; + static const ::flatbuffers::TypeTable *MiniReflectTypeTable() { + return StablehloShiftLeftOptionsTypeTable(); + } + bool Verify(::flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + verifier.EndTable(); + } +}; + +struct StablehloShiftLeftOptionsBuilder { + typedef StablehloShiftLeftOptions Table; + ::flatbuffers::FlatBufferBuilder &fbb_; + ::flatbuffers::uoffset_t start_; + explicit StablehloShiftLeftOptionsBuilder(::flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ::flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = ::flatbuffers::Offset(end); + return o; + } +}; + +inline ::flatbuffers::Offset CreateStablehloShiftLeftOptions( + ::flatbuffers::FlatBufferBuilder &_fbb) { + StablehloShiftLeftOptionsBuilder builder_(_fbb); + return builder_.Finish(); +} + struct Operator FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { typedef OperatorBuilder Builder; static const ::flatbuffers::TypeTable *MiniReflectTypeTable() { @@ -12377,7 +12427,8 @@ struct Operator FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { VT_LARGE_CUSTOM_OPTIONS_OFFSET = 22, VT_LARGE_CUSTOM_OPTIONS_SIZE = 24, VT_BUILTIN_OPTIONS_2_TYPE = 26, - VT_BUILTIN_OPTIONS_2 = 28 + VT_BUILTIN_OPTIONS_2 = 28, + VT_DEBUG_METADATA_INDEX = 30 }; uint32_t opcode_index() const { return GetField(VT_OPCODE_INDEX, 0); @@ -12891,9 +12942,18 @@ struct Operator FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { const tflite::StableHLOCompositeOptions *builtin_options_2_as_StableHLOCompositeOptions() const { return builtin_options_2_type() == tflite::BuiltinOptions2::StableHLOCompositeOptions ? static_cast(builtin_options_2()) : nullptr; } + const tflite::StablehloShiftLeftOptions *builtin_options_2_as_StablehloShiftLeftOptions() const { + return builtin_options_2_type() == tflite::BuiltinOptions2::StablehloShiftLeftOptions ? static_cast(builtin_options_2()) : nullptr; + } void *mutable_builtin_options_2() { return GetPointer(VT_BUILTIN_OPTIONS_2); } + int32_t debug_metadata_index() const { + return GetField(VT_DEBUG_METADATA_INDEX, -1); + } + bool mutate_debug_metadata_index(int32_t _debug_metadata_index = -1) { + return SetField(VT_DEBUG_METADATA_INDEX, _debug_metadata_index, -1); + } bool Verify(::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_OPCODE_INDEX, 4) && @@ -12916,6 +12976,7 @@ struct Operator FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { VerifyField(verifier, VT_BUILTIN_OPTIONS_2_TYPE, 1) && VerifyOffset(verifier, VT_BUILTIN_OPTIONS_2) && VerifyBuiltinOptions2(verifier, builtin_options_2(), builtin_options_2_type()) && + VerifyField(verifier, VT_DEBUG_METADATA_INDEX, 4) && verifier.EndTable(); } }; @@ -13508,6 +13569,10 @@ template<> inline const tflite::StableHLOCompositeOptions *Operator::builtin_opt return builtin_options_2_as_StableHLOCompositeOptions(); } +template<> inline const tflite::StablehloShiftLeftOptions *Operator::builtin_options_2_as() const { + return builtin_options_2_as_StablehloShiftLeftOptions(); +} + struct OperatorBuilder { typedef Operator Table; ::flatbuffers::FlatBufferBuilder &fbb_; @@ -13551,6 +13616,9 @@ struct OperatorBuilder { void add_builtin_options_2(::flatbuffers::Offset builtin_options_2) { fbb_.AddOffset(Operator::VT_BUILTIN_OPTIONS_2, builtin_options_2); } + void add_debug_metadata_index(int32_t debug_metadata_index) { + fbb_.AddElement(Operator::VT_DEBUG_METADATA_INDEX, debug_metadata_index, -1); + } explicit OperatorBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); @@ -13576,10 +13644,12 @@ inline ::flatbuffers::Offset CreateOperator( uint64_t large_custom_options_offset = 0, uint64_t large_custom_options_size = 0, tflite::BuiltinOptions2 builtin_options_2_type = tflite::BuiltinOptions2::NONE, - ::flatbuffers::Offset builtin_options_2 = 0) { + ::flatbuffers::Offset builtin_options_2 = 0, + int32_t debug_metadata_index = -1) { OperatorBuilder builder_(_fbb); builder_.add_large_custom_options_size(large_custom_options_size); builder_.add_large_custom_options_offset(large_custom_options_offset); + builder_.add_debug_metadata_index(debug_metadata_index); builder_.add_builtin_options_2(builtin_options_2); builder_.add_intermediates(intermediates); builder_.add_mutating_variable_inputs(mutating_variable_inputs); @@ -13608,7 +13678,8 @@ inline ::flatbuffers::Offset CreateOperatorDirect( uint64_t large_custom_options_offset = 0, uint64_t large_custom_options_size = 0, tflite::BuiltinOptions2 builtin_options_2_type = tflite::BuiltinOptions2::NONE, - ::flatbuffers::Offset builtin_options_2 = 0) { + ::flatbuffers::Offset builtin_options_2 = 0, + int32_t debug_metadata_index = -1) { auto inputs__ = inputs ? _fbb.CreateVector(*inputs) : 0; auto outputs__ = outputs ? _fbb.CreateVector(*outputs) : 0; auto custom_options__ = custom_options ? _fbb.CreateVector(*custom_options) : 0; @@ -13628,7 +13699,8 @@ inline ::flatbuffers::Offset CreateOperatorDirect( large_custom_options_offset, large_custom_options_size, builtin_options_2_type, - builtin_options_2); + builtin_options_2, + debug_metadata_index); } struct SubGraph FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { @@ -13641,7 +13713,8 @@ struct SubGraph FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { VT_INPUTS = 6, VT_OUTPUTS = 8, VT_OPERATORS = 10, - VT_NAME = 12 + VT_NAME = 12, + VT_DEBUG_METADATA_INDEX = 14 }; const ::flatbuffers::Vector<::flatbuffers::Offset> *tensors() const { return GetPointer> *>(VT_TENSORS); @@ -13673,6 +13746,12 @@ struct SubGraph FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { ::flatbuffers::String *mutable_name() { return GetPointer<::flatbuffers::String *>(VT_NAME); } + int32_t debug_metadata_index() const { + return GetField(VT_DEBUG_METADATA_INDEX, -1); + } + bool mutate_debug_metadata_index(int32_t _debug_metadata_index = -1) { + return SetField(VT_DEBUG_METADATA_INDEX, _debug_metadata_index, -1); + } bool Verify(::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_TENSORS) && @@ -13687,6 +13766,7 @@ struct SubGraph FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { verifier.VerifyVectorOfTables(operators()) && VerifyOffset(verifier, VT_NAME) && verifier.VerifyString(name()) && + VerifyField(verifier, VT_DEBUG_METADATA_INDEX, 4) && verifier.EndTable(); } }; @@ -13710,6 +13790,9 @@ struct SubGraphBuilder { void add_name(::flatbuffers::Offset<::flatbuffers::String> name) { fbb_.AddOffset(SubGraph::VT_NAME, name); } + void add_debug_metadata_index(int32_t debug_metadata_index) { + fbb_.AddElement(SubGraph::VT_DEBUG_METADATA_INDEX, debug_metadata_index, -1); + } explicit SubGraphBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); @@ -13727,8 +13810,10 @@ inline ::flatbuffers::Offset CreateSubGraph( ::flatbuffers::Offset<::flatbuffers::Vector> inputs = 0, ::flatbuffers::Offset<::flatbuffers::Vector> outputs = 0, ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> operators = 0, - ::flatbuffers::Offset<::flatbuffers::String> name = 0) { + ::flatbuffers::Offset<::flatbuffers::String> name = 0, + int32_t debug_metadata_index = -1) { SubGraphBuilder builder_(_fbb); + builder_.add_debug_metadata_index(debug_metadata_index); builder_.add_name(name); builder_.add_operators(operators); builder_.add_outputs(outputs); @@ -13743,7 +13828,8 @@ inline ::flatbuffers::Offset CreateSubGraphDirect( const std::vector *inputs = nullptr, const std::vector *outputs = nullptr, const std::vector<::flatbuffers::Offset> *operators = nullptr, - const char *name = nullptr) { + const char *name = nullptr, + int32_t debug_metadata_index = -1) { auto tensors__ = tensors ? _fbb.CreateVector<::flatbuffers::Offset>(*tensors) : 0; auto inputs__ = inputs ? _fbb.CreateVector(*inputs) : 0; auto outputs__ = outputs ? _fbb.CreateVector(*outputs) : 0; @@ -13755,7 +13841,8 @@ inline ::flatbuffers::Offset CreateSubGraphDirect( inputs__, outputs__, operators__, - name__); + name__, + debug_metadata_index); } struct Buffer FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { @@ -14949,6 +15036,10 @@ inline bool VerifyBuiltinOptions2(::flatbuffers::Verifier &verifier, const void auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } + case BuiltinOptions2::StablehloShiftLeftOptions: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } default: return true; } } @@ -15285,6 +15376,8 @@ inline const ::flatbuffers::TypeTable *BuiltinOperatorTypeTable() { { ::flatbuffers::ET_INT, 0, 0 }, { ::flatbuffers::ET_INT, 0, 0 }, { ::flatbuffers::ET_INT, 0, 0 }, + { ::flatbuffers::ET_INT, 0, 0 }, + { ::flatbuffers::ET_INT, 0, 0 }, { ::flatbuffers::ET_INT, 0, 0 } }; static const ::flatbuffers::TypeFunction type_refs[] = { @@ -15497,10 +15590,12 @@ inline const ::flatbuffers::TypeTable *BuiltinOperatorTypeTable() { "DILATE", "STABLEHLO_RNG_BIT_GENERATOR", "REDUCE_WINDOW", - "STABLEHLO_COMPOSITE" + "STABLEHLO_COMPOSITE", + "STABLEHLO_SHIFT_LEFT", + "STABLEHLO_CBRT" }; static const ::flatbuffers::TypeTable tt = { - ::flatbuffers::ST_ENUM, 207, type_codes, type_refs, nullptr, nullptr, names + ::flatbuffers::ST_ENUM, 209, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } @@ -15921,7 +16016,8 @@ inline const ::flatbuffers::TypeTable *BuiltinOptions2TypeTable() { { ::flatbuffers::ET_SEQUENCE, 0, 17 }, { ::flatbuffers::ET_SEQUENCE, 0, 18 }, { ::flatbuffers::ET_SEQUENCE, 0, 19 }, - { ::flatbuffers::ET_SEQUENCE, 0, 20 } + { ::flatbuffers::ET_SEQUENCE, 0, 20 }, + { ::flatbuffers::ET_SEQUENCE, 0, 21 } }; static const ::flatbuffers::TypeFunction type_refs[] = { tflite::StablehloConcatenateOptionsTypeTable, @@ -15944,7 +16040,8 @@ inline const ::flatbuffers::TypeTable *BuiltinOptions2TypeTable() { tflite::DilateOptionsTypeTable, tflite::StablehloRngBitGeneratorOptionsTypeTable, tflite::ReduceWindowOptionsTypeTable, - tflite::StableHLOCompositeOptionsTypeTable + tflite::StableHLOCompositeOptionsTypeTable, + tflite::StablehloShiftLeftOptionsTypeTable }; static const char * const names[] = { "NONE", @@ -15968,10 +16065,11 @@ inline const ::flatbuffers::TypeTable *BuiltinOptions2TypeTable() { "DilateOptions", "StablehloRngBitGeneratorOptions", "ReduceWindowOptions", - "StableHLOCompositeOptions" + "StableHLOCompositeOptions", + "StablehloShiftLeftOptions" }; static const ::flatbuffers::TypeTable tt = { - ::flatbuffers::ST_UNION, 22, type_codes, type_refs, nullptr, nullptr, names + ::flatbuffers::ST_UNION, 23, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } @@ -18364,6 +18462,13 @@ inline const ::flatbuffers::TypeTable *StableHLOCompositeOptionsTypeTable() { return &tt; } +inline const ::flatbuffers::TypeTable *StablehloShiftLeftOptionsTypeTable() { + static const ::flatbuffers::TypeTable tt = { + ::flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr + }; + return &tt; +} + inline const ::flatbuffers::TypeTable *OperatorTypeTable() { static const ::flatbuffers::TypeCode type_codes[] = { { ::flatbuffers::ET_UINT, 0, -1 }, @@ -18378,7 +18483,8 @@ inline const ::flatbuffers::TypeTable *OperatorTypeTable() { { ::flatbuffers::ET_ULONG, 0, -1 }, { ::flatbuffers::ET_ULONG, 0, -1 }, { ::flatbuffers::ET_UTYPE, 0, 2 }, - { ::flatbuffers::ET_SEQUENCE, 0, 2 } + { ::flatbuffers::ET_SEQUENCE, 0, 2 }, + { ::flatbuffers::ET_INT, 0, -1 } }; static const ::flatbuffers::TypeFunction type_refs[] = { tflite::BuiltinOptionsTypeTable, @@ -18398,10 +18504,11 @@ inline const ::flatbuffers::TypeTable *OperatorTypeTable() { "large_custom_options_offset", "large_custom_options_size", "builtin_options_2_type", - "builtin_options_2" + "builtin_options_2", + "debug_metadata_index" }; static const ::flatbuffers::TypeTable tt = { - ::flatbuffers::ST_TABLE, 13, type_codes, type_refs, nullptr, nullptr, names + ::flatbuffers::ST_TABLE, 14, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } @@ -18412,7 +18519,8 @@ inline const ::flatbuffers::TypeTable *SubGraphTypeTable() { { ::flatbuffers::ET_INT, 1, -1 }, { ::flatbuffers::ET_INT, 1, -1 }, { ::flatbuffers::ET_SEQUENCE, 1, 1 }, - { ::flatbuffers::ET_STRING, 0, -1 } + { ::flatbuffers::ET_STRING, 0, -1 }, + { ::flatbuffers::ET_INT, 0, -1 } }; static const ::flatbuffers::TypeFunction type_refs[] = { tflite::TensorTypeTable, @@ -18423,10 +18531,11 @@ inline const ::flatbuffers::TypeTable *SubGraphTypeTable() { "inputs", "outputs", "operators", - "name" + "name", + "debug_metadata_index" }; static const ::flatbuffers::TypeTable tt = { - ::flatbuffers::ST_TABLE, 5, type_codes, type_refs, nullptr, nullptr, names + ::flatbuffers::ST_TABLE, 6, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } diff --git a/ethosu/vela/tflite/BuiltinOperator.py b/ethosu/vela/tflite/BuiltinOperator.py index 823c31e88da073ba4e2cf788063fdbd689ec3d84..130e3986057562a8f8fefafd47be0b82fe433652 100644 --- a/ethosu/vela/tflite/BuiltinOperator.py +++ b/ethosu/vela/tflite/BuiltinOperator.py @@ -210,3 +210,5 @@ class BuiltinOperator(object): STABLEHLO_RNG_BIT_GENERATOR = 204 REDUCE_WINDOW = 205 STABLEHLO_COMPOSITE = 206 + STABLEHLO_SHIFT_LEFT = 207 + STABLEHLO_CBRT = 208 diff --git a/ethosu/vela/tflite/BuiltinOptions2.py b/ethosu/vela/tflite/BuiltinOptions2.py index 151461873e4fa2c4e952c3fb97f1717e553f3604..bbaaded535a40850545f0f724a0c2fa5f75232fb 100644 --- a/ethosu/vela/tflite/BuiltinOptions2.py +++ b/ethosu/vela/tflite/BuiltinOptions2.py @@ -25,3 +25,4 @@ class BuiltinOptions2(object): StablehloRngBitGeneratorOptions = 19 ReduceWindowOptions = 20 StableHLOCompositeOptions = 21 + StablehloShiftLeftOptions = 22 diff --git a/ethosu/vela/tflite/Operator.py b/ethosu/vela/tflite/Operator.py index 12d1ee2836232e39846fb350a16e5eb7434400d4..07705145dc9461a9fbe49ceeeb9345b5d6fc4d0e 100644 --- a/ethosu/vela/tflite/Operator.py +++ b/ethosu/vela/tflite/Operator.py @@ -225,8 +225,15 @@ class Operator(object): return obj return None + # Operator + def DebugMetadataIndex(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return -1 + def OperatorStart(builder): - builder.StartObject(13) + builder.StartObject(14) def Start(builder): OperatorStart(builder) @@ -339,6 +346,12 @@ def OperatorAddBuiltinOptions2(builder, builtinOptions2): def AddBuiltinOptions2(builder, builtinOptions2): OperatorAddBuiltinOptions2(builder, builtinOptions2) +def OperatorAddDebugMetadataIndex(builder, debugMetadataIndex): + builder.PrependInt32Slot(13, debugMetadataIndex, -1) + +def AddDebugMetadataIndex(builder, debugMetadataIndex): + OperatorAddDebugMetadataIndex(builder, debugMetadataIndex) + def OperatorEnd(builder): return builder.EndObject() diff --git a/ethosu/vela/tflite/StablehloShiftLeftOptions.py b/ethosu/vela/tflite/StablehloShiftLeftOptions.py new file mode 100644 index 0000000000000000000000000000000000000000..9c1f89663c81847dfcec0295ff0f155fbebfe544 --- /dev/null +++ b/ethosu/vela/tflite/StablehloShiftLeftOptions.py @@ -0,0 +1,41 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class StablehloShiftLeftOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAs(cls, buf, offset=0): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = StablehloShiftLeftOptions() + x.Init(buf, n + offset) + return x + + @classmethod + def GetRootAsStablehloShiftLeftOptions(cls, buf, offset=0): + """This method is deprecated. Please switch to GetRootAs.""" + return cls.GetRootAs(buf, offset) + @classmethod + def StablehloShiftLeftOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): + return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) + + # StablehloShiftLeftOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def StablehloShiftLeftOptionsStart(builder): + builder.StartObject(0) + +def Start(builder): + StablehloShiftLeftOptionsStart(builder) + +def StablehloShiftLeftOptionsEnd(builder): + return builder.EndObject() + +def End(builder): + return StablehloShiftLeftOptionsEnd(builder) diff --git a/ethosu/vela/tflite/SubGraph.py b/ethosu/vela/tflite/SubGraph.py index f58980aab1080cc50f81b0eaf18476cb9a48877c..873f3e28240a2c2f656ca75fcfa8965c71bd2dcb 100644 --- a/ethosu/vela/tflite/SubGraph.py +++ b/ethosu/vela/tflite/SubGraph.py @@ -139,8 +139,15 @@ class SubGraph(object): return self._tab.String(o + self._tab.Pos) return None + # SubGraph + def DebugMetadataIndex(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return -1 + def SubGraphStart(builder): - builder.StartObject(5) + builder.StartObject(6) def Start(builder): SubGraphStart(builder) @@ -199,6 +206,12 @@ def SubGraphAddName(builder, name): def AddName(builder, name): SubGraphAddName(builder, name) +def SubGraphAddDebugMetadataIndex(builder, debugMetadataIndex): + builder.PrependInt32Slot(5, debugMetadataIndex, -1) + +def AddDebugMetadataIndex(builder, debugMetadataIndex): + SubGraphAddDebugMetadataIndex(builder, debugMetadataIndex) + def SubGraphEnd(builder): return builder.EndObject() diff --git a/pyproject.toml b/pyproject.toml index 233c073c87f1ce4c2e1792fbbadccc8853b49ef3..75e158478bbea2281185fcc824ad8639797df9dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ classifiers = [ keywords = ["ethos-u", "vela compiler", "tflite", "npu"] # Third-party dependency versions are restricted based upon compatibility and security concerns. dependencies = [ - "flatbuffers==24.3.25", + "flatbuffers==24.12.23", "numpy>=1.23.0", "lxml>=4.5.2" ]