@@ -204,6 +204,7 @@ class OperatorAttrs(object):
204204 QuantizeLinearAttrs = 42
205205 DepthToSpaceAttrs = 43
206206 CastLikeAttrs = 44
207+ ShapeAttrs = 45
207208
208209def OperatorAttrsCreator (unionType , table ):
209210 from flatbuffers .table import Table
@@ -297,6 +298,8 @@ def OperatorAttrsCreator(unionType, table):
297298 return DepthToSpaceAttrsT .InitFromBuf (table .Bytes , table .Pos )
298299 if unionType == OperatorAttrs .CastLikeAttrs :
299300 return CastLikeAttrsT .InitFromBuf (table .Bytes , table .Pos )
301+ if unionType == OperatorAttrs .ShapeAttrs :
302+ return ShapeAttrsT .InitFromBuf (table .Bytes , table .Pos )
300303 return None
301304
302305
@@ -4631,6 +4634,96 @@ def Pack(self, builder):
46314634 return scatterNdattrs
46324635
46334636
4637+ class ShapeAttrs (object ):
4638+ __slots__ = ['_tab' ]
4639+
4640+ @classmethod
4641+ def GetRootAs (cls , buf , offset = 0 ):
4642+ n = flatbuffers .encode .Get (flatbuffers .packer .uoffset , buf , offset )
4643+ x = ShapeAttrs ()
4644+ x .Init (buf , n + offset )
4645+ return x
4646+
4647+ @classmethod
4648+ def GetRootAsShapeAttrs (cls , buf , offset = 0 ):
4649+ """This method is deprecated. Please switch to GetRootAs."""
4650+ return cls .GetRootAs (buf , offset )
4651+ @classmethod
4652+ def ShapeAttrsBufferHasIdentifier (cls , buf , offset , size_prefixed = False ):
4653+ return flatbuffers .util .BufferHasIdentifier (buf , offset , b"\x52 \x54 \x45 \x4E " , size_prefixed = size_prefixed )
4654+
4655+ # ShapeAttrs
4656+ def Init (self , buf , pos ):
4657+ self ._tab = flatbuffers .table .Table (buf , pos )
4658+
4659+ # ShapeAttrs
4660+ def Start (self ):
4661+ o = flatbuffers .number_types .UOffsetTFlags .py_type (self ._tab .Offset (4 ))
4662+ if o != 0 :
4663+ return self ._tab .Get (flatbuffers .number_types .Int32Flags , o + self ._tab .Pos )
4664+ return None
4665+
4666+ # ShapeAttrs
4667+ def End (self ):
4668+ o = flatbuffers .number_types .UOffsetTFlags .py_type (self ._tab .Offset (6 ))
4669+ if o != 0 :
4670+ return self ._tab .Get (flatbuffers .number_types .Int32Flags , o + self ._tab .Pos )
4671+ return None
4672+
4673+ def ShapeAttrsStart (builder ):
4674+ builder .StartObject (2 )
4675+
4676+ def ShapeAttrsAddStart (builder , start ):
4677+ builder .PrependInt32Slot (0 , start , None )
4678+
4679+ def ShapeAttrsAddEnd (builder , end ):
4680+ builder .PrependInt32Slot (1 , end , None )
4681+
4682+ def ShapeAttrsEnd (builder ):
4683+ return builder .EndObject ()
4684+
4685+
4686+
4687+ class ShapeAttrsT (object ):
4688+
4689+ # ShapeAttrsT
4690+ def __init__ (self ):
4691+ self .start = None # type: Optional[int]
4692+ self .end = None # type: Optional[int]
4693+
4694+ @classmethod
4695+ def InitFromBuf (cls , buf , pos ):
4696+ shapeAttrs = ShapeAttrs ()
4697+ shapeAttrs .Init (buf , pos )
4698+ return cls .InitFromObj (shapeAttrs )
4699+
4700+ @classmethod
4701+ def InitFromPackedBuf (cls , buf , pos = 0 ):
4702+ n = flatbuffers .encode .Get (flatbuffers .packer .uoffset , buf , pos )
4703+ return cls .InitFromBuf (buf , pos + n )
4704+
4705+ @classmethod
4706+ def InitFromObj (cls , shapeAttrs ):
4707+ x = ShapeAttrsT ()
4708+ x ._UnPack (shapeAttrs )
4709+ return x
4710+
4711+ # ShapeAttrsT
4712+ def _UnPack (self , shapeAttrs ):
4713+ if shapeAttrs is None :
4714+ return
4715+ self .start = shapeAttrs .Start ()
4716+ self .end = shapeAttrs .End ()
4717+
4718+ # ShapeAttrsT
4719+ def Pack (self , builder ):
4720+ ShapeAttrsStart (builder )
4721+ ShapeAttrsAddStart (builder , self .start )
4722+ ShapeAttrsAddEnd (builder , self .end )
4723+ shapeAttrs = ShapeAttrsEnd (builder )
4724+ return shapeAttrs
4725+
4726+
46344727class SoftmaxAttrs (object ):
46354728 __slots__ = ['_tab' ]
46364729
@@ -5223,7 +5316,7 @@ class OperatorNodeT(object):
52235316 def __init__ (self ):
52245317 self .type = 0 # type: int
52255318 self .attrsType = 0 # type: int
5226- self .attrs = None # type: Union[None, ArgMaxAttrsT, AveragePoolAttrsT, BatchNormalizationAttrsT, CastAttrsT, ConcatAttrsT, ConstantOfShapeAttrsT, ConvAttrsT, ConvTransposeAttrsT, FlattenAttrsT, GatherAttrsT, GemmAttrsT, GRUAttrsT, LeakyReluAttrsT, LSTMAttrsT, MaxPoolAttrsT, ReduceMeanAttrsT, ReshapeAttrsT, ResizeAttrsT, SplitAttrsT, SoftmaxAttrsT, TransposeAttrsT, ModAttrsT, ScatterElementsAttrsT, OneHotAttrsT, TopKAttrsT, HardSigmoidAttrsT, TriluAttrsT, ScatterNDAttrsT, NonMaxSuppressionAttrsT, LayerNormalizationAttrsT, RandomUniformAttrsT, EluAttrsT, RandomUniformLikeAttrsT, RandomNormalAttrsT, RandomNormalLikeAttrsT, GatherNDAttrsT, GeluAttrsT, EinsumAttrsT, IfAttrsT, PadAttrsT, DequantizeLinearAttrsT, QuantizeLinearAttrsT, DepthToSpaceAttrsT, CastLikeAttrsT]
5319+ self .attrs = None # type: Union[None, ArgMaxAttrsT, AveragePoolAttrsT, BatchNormalizationAttrsT, CastAttrsT, ConcatAttrsT, ConstantOfShapeAttrsT, ConvAttrsT, ConvTransposeAttrsT, FlattenAttrsT, GatherAttrsT, GemmAttrsT, GRUAttrsT, LeakyReluAttrsT, LSTMAttrsT, MaxPoolAttrsT, ReduceMeanAttrsT, ReshapeAttrsT, ResizeAttrsT, SplitAttrsT, SoftmaxAttrsT, TransposeAttrsT, ModAttrsT, ScatterElementsAttrsT, OneHotAttrsT, TopKAttrsT, HardSigmoidAttrsT, TriluAttrsT, ScatterNDAttrsT, NonMaxSuppressionAttrsT, LayerNormalizationAttrsT, RandomUniformAttrsT, EluAttrsT, RandomUniformLikeAttrsT, RandomNormalAttrsT, RandomNormalLikeAttrsT, GatherNDAttrsT, GeluAttrsT, EinsumAttrsT, IfAttrsT, PadAttrsT, DequantizeLinearAttrsT, QuantizeLinearAttrsT, DepthToSpaceAttrsT, CastLikeAttrsT, ShapeAttrsT ]
52275320 self .inputs = None # type: List[int]
52285321 self .outputs = None # type: List[int]
52295322
0 commit comments