Skip to content

Commit b44f2fe

Browse files
committed
Sync from upstream TF.
1 parent 4813acf commit b44f2fe

File tree

5 files changed

+202
-11
lines changed

5 files changed

+202
-11
lines changed

tensorflow/lite/builtin_ops.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ typedef enum {
230230
kTfLiteBuiltinStablehloWhile = 200,
231231
kTfLiteBuiltinStablehloGather = 201,
232232
kTfLiteBuiltinStablehloTranspose = 202,
233+
kTfLiteBuiltinDilate = 203,
233234
} TfLiteBuiltinOperator;
234235

235236
#ifdef __cplusplus

tensorflow/lite/core/api/flatbuffer_conversions.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,7 @@ TfLiteStatus ParseOpDataTfLite(const Operator* op, BuiltinOperator op_type,
983983
case BuiltinOperator_SIGN:
984984
case BuiltinOperator_BITCAST:
985985
case BuiltinOperator_WHERE:
986+
case BuiltinOperator_DILATE:
986987
return kTfLiteOk;
987988
case BuiltinOperator_PLACEHOLDER_FOR_GREATER_OP_CODES:
988989
return kTfLiteError;

tensorflow/lite/python/schema_py_generated.py

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,7 @@ class BuiltinOperator(object):
15921592
STABLEHLO_WHILE = 200
15931593
STABLEHLO_GATHER = 201
15941594
STABLEHLO_TRANSPOSE = 202
1595+
DILATE = 203
15951596
# automatically generated by the FlatBuffers compiler, do not modify
15961597

15971598
# namespace: tflite
@@ -2005,6 +2006,7 @@ class BuiltinOptions2(object):
20052006
StablehloWhileOptions = 15
20062007
StablehloGatherOptions = 16
20072008
StablehloTransposeOptions = 17
2009+
DilateOptions = 18
20082010

20092011
def BuiltinOptions2Creator(unionType, table):
20102012
from flatbuffers.table import Table
@@ -2044,6 +2046,8 @@ def BuiltinOptions2Creator(unionType, table):
20442046
return StablehloGatherOptionsT.InitFromBuf(table.Bytes, table.Pos)
20452047
if unionType == BuiltinOptions2().StablehloTransposeOptions:
20462048
return StablehloTransposeOptionsT.InitFromBuf(table.Bytes, table.Pos)
2049+
if unionType == BuiltinOptions2().DilateOptions:
2050+
return DilateOptionsT.InitFromBuf(table.Bytes, table.Pos)
20472051
return None
20482052
# automatically generated by the FlatBuffers compiler, do not modify
20492053

@@ -3515,6 +3519,70 @@ def Pack(self, builder):
35153519
from flatbuffers.compat import import_numpy
35163520
np = import_numpy()
35173521

3522+
class DilateOptions(object):
3523+
__slots__ = ['_tab']
3524+
3525+
@classmethod
3526+
def GetRootAs(cls, buf, offset=0):
3527+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
3528+
x = DilateOptions()
3529+
x.Init(buf, n + offset)
3530+
return x
3531+
3532+
@classmethod
3533+
def GetRootAsDilateOptions(cls, buf, offset=0):
3534+
"""This method is deprecated. Please switch to GetRootAs."""
3535+
return cls.GetRootAs(buf, offset)
3536+
@classmethod
3537+
def DilateOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
3538+
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
3539+
3540+
# DilateOptions
3541+
def Init(self, buf, pos):
3542+
self._tab = flatbuffers.table.Table(buf, pos)
3543+
3544+
def DilateOptionsStart(builder): builder.StartObject(0)
3545+
def Start(builder):
3546+
return DilateOptionsStart(builder)
3547+
def DilateOptionsEnd(builder): return builder.EndObject()
3548+
def End(builder):
3549+
return DilateOptionsEnd(builder)
3550+
3551+
class DilateOptionsT(object):
3552+
3553+
# DilateOptionsT
3554+
def __init__(self):
3555+
pass
3556+
3557+
@classmethod
3558+
def InitFromBuf(cls, buf, pos):
3559+
dilateOptions = DilateOptions()
3560+
dilateOptions.Init(buf, pos)
3561+
return cls.InitFromObj(dilateOptions)
3562+
3563+
@classmethod
3564+
def InitFromObj(cls, dilateOptions):
3565+
x = DilateOptionsT()
3566+
x._UnPack(dilateOptions)
3567+
return x
3568+
3569+
# DilateOptionsT
3570+
def _UnPack(self, dilateOptions):
3571+
if dilateOptions is None:
3572+
return
3573+
3574+
# DilateOptionsT
3575+
def Pack(self, builder):
3576+
DilateOptionsStart(builder)
3577+
dilateOptions = DilateOptionsEnd(builder)
3578+
return dilateOptions
3579+
# automatically generated by the FlatBuffers compiler, do not modify
3580+
3581+
# namespace: tflite
3582+
3583+
from flatbuffers.compat import import_numpy
3584+
np = import_numpy()
3585+
35183586
class DimensionMetadata(object):
35193587
__slots__ = ['_tab']
35203588

@@ -7775,7 +7843,7 @@ def __init__(self):
77757843
self.largeCustomOptionsOffset = 0 # type: int
77767844
self.largeCustomOptionsSize = 0 # type: int
77777845
self.builtinOptions2Type = 0 # type: int
7778-
self.builtinOptions2 = None # type: Union[None, StablehloConcatenateOptionsT, StablehloBroadcastInDimOptionsT, StablehloSliceOptionsT, StablehloConvolutionOptionsT, StablehloCustomCallOptionsT, StablehloReduceOptionsT, StablehloScatterOptionsT, StablehloCompareOptionsT, StablehloDynamicSliceOptionsT, StablehloPadOptionsT, StablehloIotaOptionsT, StablehloDotGeneralOptionsT, StablehloReduceWindowOptionsT, StablehloSortOptionsT, StablehloWhileOptionsT, StablehloGatherOptionsT, StablehloTransposeOptionsT]
7846+
self.builtinOptions2 = None # type: Union[None, StablehloConcatenateOptionsT, StablehloBroadcastInDimOptionsT, StablehloSliceOptionsT, StablehloConvolutionOptionsT, StablehloCustomCallOptionsT, StablehloReduceOptionsT, StablehloScatterOptionsT, StablehloCompareOptionsT, StablehloDynamicSliceOptionsT, StablehloPadOptionsT, StablehloIotaOptionsT, StablehloDotGeneralOptionsT, StablehloReduceWindowOptionsT, StablehloSortOptionsT, StablehloWhileOptionsT, StablehloGatherOptionsT, StablehloTransposeOptionsT, DilateOptionsT]
77797847

77807848
@classmethod
77817849
def InitFromBuf(cls, buf, pos):

tensorflow/lite/schema/schema.fbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ enum BuiltinOperator : int32 {
467467
STABLEHLO_WHILE = 200, // WARNING: No runtime support
468468
STABLEHLO_GATHER = 201, // WARNING: No runtime support
469469
STABLEHLO_TRANSPOSE = 202, // WARNING: No runtime support
470+
DILATE = 203,
470471
}
471472
// LINT.ThenChange(nnapi_linter/linter.proto)
472473

@@ -621,6 +622,7 @@ union BuiltinOptions2{
621622
StablehloWhileOptions,
622623
StablehloGatherOptions,
623624
StablehloTransposeOptions,
625+
DilateOptions,
624626
}
625627

626628
table StablehloGatherOptions{
@@ -1410,6 +1412,9 @@ table BitwiseXorOptions {
14101412
table RightShiftOptions {
14111413
}
14121414

1415+
table DilateOptions {
1416+
}
1417+
14131418
// An OperatorCode can be an enum value (BuiltinOperator) if the operator is a
14141419
// builtin, or a string if the operator is custom.
14151420
table OperatorCode {

0 commit comments

Comments
 (0)