@@ -204,6 +204,7 @@ class OperatorAttrs(object):
204
204
QuantizeLinearAttrs = 42
205
205
DepthToSpaceAttrs = 43
206
206
CastLikeAttrs = 44
207
+ ShapeAttrs = 45
207
208
208
209
def OperatorAttrsCreator (unionType , table ):
209
210
from flatbuffers .table import Table
@@ -297,6 +298,8 @@ def OperatorAttrsCreator(unionType, table):
297
298
return DepthToSpaceAttrsT .InitFromBuf (table .Bytes , table .Pos )
298
299
if unionType == OperatorAttrs .CastLikeAttrs :
299
300
return CastLikeAttrsT .InitFromBuf (table .Bytes , table .Pos )
301
+ if unionType == OperatorAttrs .ShapeAttrs :
302
+ return ShapeAttrsT .InitFromBuf (table .Bytes , table .Pos )
300
303
return None
301
304
302
305
@@ -4631,6 +4634,96 @@ def Pack(self, builder):
4631
4634
return scatterNdattrs
4632
4635
4633
4636
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
+
4634
4727
class SoftmaxAttrs (object ):
4635
4728
__slots__ = ['_tab' ]
4636
4729
@@ -5223,7 +5316,7 @@ class OperatorNodeT(object):
5223
5316
def __init__ (self ):
5224
5317
self .type = 0 # type: int
5225
5318
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 ]
5227
5320
self .inputs = None # type: List[int]
5228
5321
self .outputs = None # type: List[int]
5229
5322
0 commit comments