blob: e446c03c8e2ad2ba92da0035ed46a4c8bb123f00 [file] [log] [blame]
Eric Kunzee5e26762020-10-13 16:11:07 -07001# automatically generated by the FlatBuffers compiler, do not modify
2
3# Copyright (c) 2020, ARM Limited.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17
18# namespace: tosa
19
20import flatbuffers
21
22class ReluNAttribute(object):
23 __slots__ = ['_tab']
24
25 @classmethod
26 def GetRootAsReluNAttribute(cls, buf, offset):
27 n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
28 x = ReluNAttribute()
29 x.Init(buf, n + offset)
30 return x
31
32 # ReluNAttribute
33 def Init(self, buf, pos):
34 self._tab = flatbuffers.table.Table(buf, pos)
35
36 # ReluNAttribute
37 def MaxInt(self):
38 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
39 if o != 0:
40 return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
41 return 0
42
43 # ReluNAttribute
44 def MaxFp(self):
45 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
46 if o != 0:
47 return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
48 return 0.0
49
50def ReluNAttributeStart(builder): builder.StartObject(2)
51def ReluNAttributeAddMaxInt(builder, maxInt): builder.PrependInt32Slot(0, maxInt, 0)
52def ReluNAttributeAddMaxFp(builder, maxFp): builder.PrependFloat32Slot(1, maxFp, 0.0)
53def ReluNAttributeEnd(builder): return builder.EndObject()