aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatWai Chong <tatwai.chong@arm.com>2022-06-10 01:49:13 -0700
committerTatWai Chong <tatwai.chong@arm.com>2022-08-03 22:08:06 +0000
commit49b1ca63975d4f1865ca312ed9c9b5e0008e13e0 (patch)
tree27a581a656a3c79d0250f4ca490c96aacbb8dfd6
parent4417b428061276a88c41825f2e46e2dce387dd0a (diff)
downloadserialization_lib-main.tar.gz
Update TOSA resize to match specificationHEADmain
Attribute stride and shift are removed, and has new scale and border. For serializing int16 attributes, add a new member vector container and a building function to do so. Signed-off-by: TatWai Chong <tatwai.chong@arm.com> Change-Id: I6d101a37d294dcf0a4d5bbb6c64bfa3c49a98f9e
-rw-r--r--include/attribute.def11
-rw-r--r--include/tosa_generated.h104
-rw-r--r--python/serializer/tosa_serializer.py48
-rw-r--r--python/tosa/ResizeAttribute.py120
-rw-r--r--schema/tosa.fbs9
5 files changed, 90 insertions, 202 deletions
diff --git a/include/attribute.def b/include/attribute.def
index ea91869..b40a77b 100644
--- a/include/attribute.def
+++ b/include/attribute.def
@@ -65,13 +65,10 @@ DEF_ATTRIBUTE(Slice, 2,
DEF_ATTRIBUTE(Tile, 1,
int32_t, V, multiples)
-DEF_ATTRIBUTE(Resize, 7,
- int32_t, V, output_size,
- int32_t, V, stride,
- int32_t, V, offset,
- int32_t, S, shift,
- float, V, stride_fp,
- float, V, offset_fp,
+DEF_ATTRIBUTE(Resize, 4,
+ int16_t, V, scale,
+ int16_t, V, offset,
+ int16_t, V, border,
ResizeMode, S, mode)
DEF_ATTRIBUTE(Clamp, 4,
diff --git a/include/tosa_generated.h b/include/tosa_generated.h
index 023825d..c39bfb7 100644
--- a/include/tosa_generated.h
+++ b/include/tosa_generated.h
@@ -1178,48 +1178,31 @@ inline flatbuffers::Offset<TileAttribute> CreateTileAttributeDirect(
struct ResizeAttribute FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef ResizeAttributeBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
- VT_OUTPUT_SIZE = 4,
- VT_STRIDE = 6,
- VT_OFFSET = 8,
- VT_SHIFT = 10,
- VT_STRIDE_FP = 12,
- VT_OFFSET_FP = 14,
- VT_MODE = 16
+ VT_SCALE = 4,
+ VT_OFFSET = 6,
+ VT_BORDER = 8,
+ VT_MODE = 10
};
- const flatbuffers::Vector<int32_t> *output_size() const {
- return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_OUTPUT_SIZE);
- }
- const flatbuffers::Vector<int32_t> *stride() const {
- return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_STRIDE);
- }
- const flatbuffers::Vector<int32_t> *offset() const {
- return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_OFFSET);
+ const flatbuffers::Vector<int16_t> *scale() const {
+ return GetPointer<const flatbuffers::Vector<int16_t> *>(VT_SCALE);
}
- int32_t shift() const {
- return GetField<int32_t>(VT_SHIFT, 0);
- }
- const flatbuffers::Vector<float> *stride_fp() const {
- return GetPointer<const flatbuffers::Vector<float> *>(VT_STRIDE_FP);
+ const flatbuffers::Vector<int16_t> *offset() const {
+ return GetPointer<const flatbuffers::Vector<int16_t> *>(VT_OFFSET);
}
- const flatbuffers::Vector<float> *offset_fp() const {
- return GetPointer<const flatbuffers::Vector<float> *>(VT_OFFSET_FP);
+ const flatbuffers::Vector<int16_t> *border() const {
+ return GetPointer<const flatbuffers::Vector<int16_t> *>(VT_BORDER);
}
tosa::ResizeMode mode() const {
return static_cast<tosa::ResizeMode>(GetField<uint32_t>(VT_MODE, 0));
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
- VerifyOffset(verifier, VT_OUTPUT_SIZE) &&
- verifier.VerifyVector(output_size()) &&
- VerifyOffset(verifier, VT_STRIDE) &&
- verifier.VerifyVector(stride()) &&
+ VerifyOffset(verifier, VT_SCALE) &&
+ verifier.VerifyVector(scale()) &&
VerifyOffset(verifier, VT_OFFSET) &&
verifier.VerifyVector(offset()) &&
- VerifyField<int32_t>(verifier, VT_SHIFT) &&
- VerifyOffset(verifier, VT_STRIDE_FP) &&
- verifier.VerifyVector(stride_fp()) &&
- VerifyOffset(verifier, VT_OFFSET_FP) &&
- verifier.VerifyVector(offset_fp()) &&
+ VerifyOffset(verifier, VT_BORDER) &&
+ verifier.VerifyVector(border()) &&
VerifyField<uint32_t>(verifier, VT_MODE) &&
verifier.EndTable();
}
@@ -1229,23 +1212,14 @@ struct ResizeAttributeBuilder {
typedef ResizeAttribute Table;
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
- void add_output_size(flatbuffers::Offset<flatbuffers::Vector<int32_t>> output_size) {
- fbb_.AddOffset(ResizeAttribute::VT_OUTPUT_SIZE, output_size);
+ void add_scale(flatbuffers::Offset<flatbuffers::Vector<int16_t>> scale) {
+ fbb_.AddOffset(ResizeAttribute::VT_SCALE, scale);
}
- void add_stride(flatbuffers::Offset<flatbuffers::Vector<int32_t>> stride) {
- fbb_.AddOffset(ResizeAttribute::VT_STRIDE, stride);
- }
- void add_offset(flatbuffers::Offset<flatbuffers::Vector<int32_t>> offset) {
+ void add_offset(flatbuffers::Offset<flatbuffers::Vector<int16_t>> offset) {
fbb_.AddOffset(ResizeAttribute::VT_OFFSET, offset);
}
- void add_shift(int32_t shift) {
- fbb_.AddElement<int32_t>(ResizeAttribute::VT_SHIFT, shift, 0);
- }
- void add_stride_fp(flatbuffers::Offset<flatbuffers::Vector<float>> stride_fp) {
- fbb_.AddOffset(ResizeAttribute::VT_STRIDE_FP, stride_fp);
- }
- void add_offset_fp(flatbuffers::Offset<flatbuffers::Vector<float>> offset_fp) {
- fbb_.AddOffset(ResizeAttribute::VT_OFFSET_FP, offset_fp);
+ void add_border(flatbuffers::Offset<flatbuffers::Vector<int16_t>> border) {
+ fbb_.AddOffset(ResizeAttribute::VT_BORDER, border);
}
void add_mode(tosa::ResizeMode mode) {
fbb_.AddElement<uint32_t>(ResizeAttribute::VT_MODE, static_cast<uint32_t>(mode), 0);
@@ -1264,46 +1238,32 @@ struct ResizeAttributeBuilder {
inline flatbuffers::Offset<ResizeAttribute> CreateResizeAttribute(
flatbuffers::FlatBufferBuilder &_fbb,
- flatbuffers::Offset<flatbuffers::Vector<int32_t>> output_size = 0,
- flatbuffers::Offset<flatbuffers::Vector<int32_t>> stride = 0,
- flatbuffers::Offset<flatbuffers::Vector<int32_t>> offset = 0,
- int32_t shift = 0,
- flatbuffers::Offset<flatbuffers::Vector<float>> stride_fp = 0,
- flatbuffers::Offset<flatbuffers::Vector<float>> offset_fp = 0,
+ flatbuffers::Offset<flatbuffers::Vector<int16_t>> scale = 0,
+ flatbuffers::Offset<flatbuffers::Vector<int16_t>> offset = 0,
+ flatbuffers::Offset<flatbuffers::Vector<int16_t>> border = 0,
tosa::ResizeMode mode = tosa::ResizeMode_UNKNOWN) {
ResizeAttributeBuilder builder_(_fbb);
builder_.add_mode(mode);
- builder_.add_offset_fp(offset_fp);
- builder_.add_stride_fp(stride_fp);
- builder_.add_shift(shift);
+ builder_.add_border(border);
builder_.add_offset(offset);
- builder_.add_stride(stride);
- builder_.add_output_size(output_size);
+ builder_.add_scale(scale);
return builder_.Finish();
}
inline flatbuffers::Offset<ResizeAttribute> CreateResizeAttributeDirect(
flatbuffers::FlatBufferBuilder &_fbb,
- const std::vector<int32_t> *output_size = nullptr,
- const std::vector<int32_t> *stride = nullptr,
- const std::vector<int32_t> *offset = nullptr,
- int32_t shift = 0,
- const std::vector<float> *stride_fp = nullptr,
- const std::vector<float> *offset_fp = nullptr,
+ const std::vector<int16_t> *scale = nullptr,
+ const std::vector<int16_t> *offset = nullptr,
+ const std::vector<int16_t> *border = nullptr,
tosa::ResizeMode mode = tosa::ResizeMode_UNKNOWN) {
- auto output_size__ = output_size ? _fbb.CreateVector<int32_t>(*output_size) : 0;
- auto stride__ = stride ? _fbb.CreateVector<int32_t>(*stride) : 0;
- auto offset__ = offset ? _fbb.CreateVector<int32_t>(*offset) : 0;
- auto stride_fp__ = stride_fp ? _fbb.CreateVector<float>(*stride_fp) : 0;
- auto offset_fp__ = offset_fp ? _fbb.CreateVector<float>(*offset_fp) : 0;
+ auto scale__ = scale ? _fbb.CreateVector<int16_t>(*scale) : 0;
+ auto offset__ = offset ? _fbb.CreateVector<int16_t>(*offset) : 0;
+ auto border__ = border ? _fbb.CreateVector<int16_t>(*border) : 0;
return tosa::CreateResizeAttribute(
_fbb,
- output_size__,
- stride__,
+ scale__,
offset__,
- shift,
- stride_fp__,
- offset_fp__,
+ border__,
mode);
}
diff --git a/python/serializer/tosa_serializer.py b/python/serializer/tosa_serializer.py
index ec1c12d..27189ec 100644
--- a/python/serializer/tosa_serializer.py
+++ b/python/serializer/tosa_serializer.py
@@ -90,6 +90,7 @@ class TosaSerializerUnion:
self.bools = []
self.floats = []
self.strings = []
+ self.int16vecs = []
self.intvecs = []
self.fpvecs = []
@@ -106,6 +107,9 @@ class TosaSerializerUnion:
for fcn, val in self.intvecs:
intVecList.append((fcn, TosaSerializer.serializeInt32Vec(builder, val)))
+ for fcn, val in self.int16vecs:
+ intVecList.append((fcn, TosaSerializer.serializeInt16Vec(builder, val)))
+
for fcn, val in self.fpvecs:
fpVecList.append((fcn, TosaSerializer.serializeFpVec(builder, val)))
@@ -220,20 +224,15 @@ class TosaSerializerAttribute(TosaSerializerUnion):
self.intvecs.append((a.AddMultiples, multiples))
- def ResizeAttribute(
- self, output_size, stride, offset, shift, stride_fp, offset_fp, mode
- ):
+ def ResizeAttribute(self, scale, offset, border, mode):
from tosa import ResizeAttribute as a, Attribute
self.utype = Attribute.Attribute().ResizeAttribute
self.optFcns = (a.Start, a.End)
- self.intvecs.append((a.AddOutputSize, output_size))
- self.intvecs.append((a.AddStride, stride))
- self.intvecs.append((a.AddOffset, offset))
- self.ints.append((a.AddShift, shift))
- self.fpvecs.append((a.AddStrideFp, stride_fp))
- self.fpvecs.append((a.AddOffsetFp, offset_fp))
+ self.int16vecs.append((a.AddScale, scale))
+ self.int16vecs.append((a.AddOffset, offset))
+ self.int16vecs.append((a.AddBorder, border))
self.ints.append((a.AddMode, mode))
def ClampAttribute(self, minint, maxint, minfp, maxfp):
@@ -757,6 +756,16 @@ class TosaSerializer:
return builder.EndVector(len(vec))
@staticmethod
+ def serializeInt16Vec(builder, vec):
+ builder.StartVector(2, len(vec), 4)
+ for v in vec[::-1]:
+ builder.PrependInt16(v)
+ try:
+ return builder.EndVector()
+ except TypeError:
+ return builder.EndVector(len(vec))
+
+ @staticmethod
def serializeInt32Vec(builder, vec):
builder.StartVector(4, len(vec), 4)
for v in vec[::-1]:
@@ -963,26 +972,17 @@ class TosaSerializer:
if not hasattr(ResizeAttribute, "Start"):
ResizeAttribute.Start = ResizeAttribute.ResizeAttributeStart
- ResizeAttribute.AddOutputSize = ResizeAttribute.ResizeAttributeAddOutputSize
- ResizeAttribute.StartOutputSizeVector = (
- ResizeAttribute.ResizeAttributeStartOutputSizeVector
- )
- ResizeAttribute.AddStride = ResizeAttribute.ResizeAttributeAddStride
- ResizeAttribute.StartStrideVector = (
- ResizeAttribute.ResizeAttributeStartStrideVector
+ ResizeAttribute.AddScale = ResizeAttribute.ResizeAttributeAddScale
+ ResizeAttribute.StartScaleVector = (
+ ResizeAttribute.ResizeAttributeStartScaleVector
)
ResizeAttribute.AddOffset = ResizeAttribute.ResizeAttributeAddOffset
ResizeAttribute.StartOffsetVector = (
ResizeAttribute.ResizeAttributeStartOffsetVector
)
- ResizeAttribute.AddShift = ResizeAttribute.ResizeAttributeAddShift
- ResizeAttribute.AddStrideFp = ResizeAttribute.ResizeAttributeAddStrideFp
- ResizeAttribute.StartStrideFpVector = (
- ResizeAttribute.ResizeAttributeStartStrideFpVector
- )
- ResizeAttribute.AddOffsetFp = ResizeAttribute.ResizeAttributeAddOffsetFp
- ResizeAttribute.StartOffsetFpVector = (
- ResizeAttribute.ResizeAttributeStartOffsetFpVector
+ ResizeAttribute.AddBorder = ResizeAttribute.ResizeAttributeAddBorder
+ ResizeAttribute.StartBorderVector = (
+ ResizeAttribute.ResizeAttributeStartBorderVector
)
ResizeAttribute.AddMode = ResizeAttribute.ResizeAttributeAddMode
ResizeAttribute.End = ResizeAttribute.ResizeAttributeEnd
diff --git a/python/tosa/ResizeAttribute.py b/python/tosa/ResizeAttribute.py
index 1ed2dc0..ae03adc 100644
--- a/python/tosa/ResizeAttribute.py
+++ b/python/tosa/ResizeAttribute.py
@@ -25,165 +25,99 @@ class ResizeAttribute(object):
self._tab = flatbuffers.table.Table(buf, pos)
# ResizeAttribute
- def OutputSize(self, j):
+ def Scale(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
- return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
+ return self._tab.Get(flatbuffers.number_types.Int16Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 2))
return 0
# ResizeAttribute
- def OutputSizeAsNumpy(self):
+ def ScaleAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
- return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
+ return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int16Flags, o)
return 0
# ResizeAttribute
- def OutputSizeLength(self):
+ def ScaleLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.VectorLen(o)
return 0
# ResizeAttribute
- def OutputSizeIsNone(self):
+ def ScaleIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
return o == 0
# ResizeAttribute
- def Stride(self, j):
+ def Offset(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
a = self._tab.Vector(o)
- return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
+ return self._tab.Get(flatbuffers.number_types.Int16Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 2))
return 0
# ResizeAttribute
- def StrideAsNumpy(self):
+ def OffsetAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
- return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
+ return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int16Flags, o)
return 0
# ResizeAttribute
- def StrideLength(self):
+ def OffsetLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.VectorLen(o)
return 0
# ResizeAttribute
- def StrideIsNone(self):
+ def OffsetIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
return o == 0
# ResizeAttribute
- def Offset(self, j):
+ def Border(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
a = self._tab.Vector(o)
- return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
+ return self._tab.Get(flatbuffers.number_types.Int16Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 2))
return 0
# ResizeAttribute
- def OffsetAsNumpy(self):
+ def BorderAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
- return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
+ return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int16Flags, o)
return 0
# ResizeAttribute
- def OffsetLength(self):
+ def BorderLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.VectorLen(o)
return 0
# ResizeAttribute
- def OffsetIsNone(self):
+ def BorderIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
return o == 0
# ResizeAttribute
- def Shift(self):
- o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
- if o != 0:
- return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
- return 0
-
- # ResizeAttribute
- def StrideFp(self, j):
- o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
- if o != 0:
- a = self._tab.Vector(o)
- return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
- return 0
-
- # ResizeAttribute
- def StrideFpAsNumpy(self):
- o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
- if o != 0:
- return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
- return 0
-
- # ResizeAttribute
- def StrideFpLength(self):
- o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
- if o != 0:
- return self._tab.VectorLen(o)
- return 0
-
- # ResizeAttribute
- def StrideFpIsNone(self):
- o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
- return o == 0
-
- # ResizeAttribute
- def OffsetFp(self, j):
- o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
- if o != 0:
- a = self._tab.Vector(o)
- return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
- return 0
-
- # ResizeAttribute
- def OffsetFpAsNumpy(self):
- o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
- if o != 0:
- return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
- return 0
-
- # ResizeAttribute
- def OffsetFpLength(self):
- o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
- if o != 0:
- return self._tab.VectorLen(o)
- return 0
-
- # ResizeAttribute
- def OffsetFpIsNone(self):
- o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
- return o == 0
-
- # ResizeAttribute
def Mode(self):
- o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
return 0
-def ResizeAttributeStart(builder): builder.StartObject(7)
-def ResizeAttributeAddOutputSize(builder, outputSize): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(outputSize), 0)
-def ResizeAttributeStartOutputSizeVector(builder, numElems): return builder.StartVector(4, numElems, 4)
-def ResizeAttributeAddStride(builder, stride): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(stride), 0)
-def ResizeAttributeStartStrideVector(builder, numElems): return builder.StartVector(4, numElems, 4)
-def ResizeAttributeAddOffset(builder, offset): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(offset), 0)
-def ResizeAttributeStartOffsetVector(builder, numElems): return builder.StartVector(4, numElems, 4)
-def ResizeAttributeAddShift(builder, shift): builder.PrependInt32Slot(3, shift, 0)
-def ResizeAttributeAddStrideFp(builder, strideFp): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(strideFp), 0)
-def ResizeAttributeStartStrideFpVector(builder, numElems): return builder.StartVector(4, numElems, 4)
-def ResizeAttributeAddOffsetFp(builder, offsetFp): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(offsetFp), 0)
-def ResizeAttributeStartOffsetFpVector(builder, numElems): return builder.StartVector(4, numElems, 4)
-def ResizeAttributeAddMode(builder, mode): builder.PrependUint32Slot(6, mode, 0)
+def ResizeAttributeStart(builder): builder.StartObject(4)
+def ResizeAttributeAddScale(builder, scale): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(scale), 0)
+def ResizeAttributeStartScaleVector(builder, numElems): return builder.StartVector(2, numElems, 2)
+def ResizeAttributeAddOffset(builder, offset): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(offset), 0)
+def ResizeAttributeStartOffsetVector(builder, numElems): return builder.StartVector(2, numElems, 2)
+def ResizeAttributeAddBorder(builder, border): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(border), 0)
+def ResizeAttributeStartBorderVector(builder, numElems): return builder.StartVector(2, numElems, 2)
+def ResizeAttributeAddMode(builder, mode): builder.PrependUint32Slot(3, mode, 0)
def ResizeAttributeEnd(builder): return builder.EndObject()
diff --git a/schema/tosa.fbs b/schema/tosa.fbs
index 57440ef..1cf6bbf 100644
--- a/schema/tosa.fbs
+++ b/schema/tosa.fbs
@@ -210,12 +210,9 @@ table TileAttribute {
}
table ResizeAttribute {
- output_size: [int32];
- stride: [int32];
- offset: [int32];
- shift: int32;
- stride_fp: [float];
- offset_fp: [float];
+ scale: [int16];
+ offset: [int16];
+ border: [int16];
mode: ResizeMode;
}