Skip to content

Commit

Permalink
Automated sync from github.com/tensorflow/tensorflow (#2187)
Browse files Browse the repository at this point in the history
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
  • Loading branch information
TFLM-bot authored Aug 25, 2023
1 parent a73eb10 commit c795f31
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 5 deletions.
15 changes: 15 additions & 0 deletions tensorflow/lite/builtin_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,21 @@ typedef enum {
kTfLiteBuiltinStablehloSlice = 172,
kTfLiteBuiltinStablehloCustomCall = 173,
kTfLiteBuiltinStablehloReduce = 174,
kTfLiteBuiltinStablehloAbs = 175,
kTfLiteBuiltinStablehloAnd = 176,
kTfLiteBuiltinStablehloCosine = 177,
kTfLiteBuiltinStablehloExponential = 178,
kTfLiteBuiltinStablehloFloor = 179,
kTfLiteBuiltinStablehloLog = 180,
kTfLiteBuiltinStablehloMinimum = 181,
kTfLiteBuiltinStablehloNegate = 182,
kTfLiteBuiltinStablehloOr = 183,
kTfLiteBuiltinStablehloPower = 184,
kTfLiteBuiltinStablehloRemainder = 185,
kTfLiteBuiltinStablehloRsqrt = 186,
kTfLiteBuiltinStablehloSelect = 187,
kTfLiteBuiltinStablehloSubtract = 188,
kTfLiteBuiltinStablehloTanh = 189,
} TfLiteBuiltinOperator;

#ifdef __cplusplus
Expand Down
15 changes: 15 additions & 0 deletions tensorflow/lite/core/api/flatbuffer_conversions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,21 @@ TfLiteStatus ParseOpDataTfLite(const Operator* op, BuiltinOperator op_type,
case BuiltinOperator_STABLEHLO_CONCATENATE:
case BuiltinOperator_STABLEHLO_CUSTOM_CALL:
case BuiltinOperator_STABLEHLO_REDUCE:
case BuiltinOperator_STABLEHLO_ABS:
case BuiltinOperator_STABLEHLO_AND:
case BuiltinOperator_STABLEHLO_COSINE:
case BuiltinOperator_STABLEHLO_EXPONENTIAL:
case BuiltinOperator_STABLEHLO_FLOOR:
case BuiltinOperator_STABLEHLO_LOG:
case BuiltinOperator_STABLEHLO_MINIMUM:
case BuiltinOperator_STABLEHLO_NEGATE:
case BuiltinOperator_STABLEHLO_OR:
case BuiltinOperator_STABLEHLO_POWER:
case BuiltinOperator_STABLEHLO_REMAINDER:
case BuiltinOperator_STABLEHLO_RSQRT:
case BuiltinOperator_STABLEHLO_SELECT:
case BuiltinOperator_STABLEHLO_SUBTRACT:
case BuiltinOperator_STABLEHLO_TANH:

// Below are the ops with no builtin_data structure.
// TODO(aselle): Implement call in BuiltinOptions, but nullptrs are
Expand Down
15 changes: 15 additions & 0 deletions tensorflow/lite/python/schema_py_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -1564,6 +1564,21 @@ class BuiltinOperator(object):
STABLEHLO_SLICE = 172
STABLEHLO_CUSTOM_CALL = 173
STABLEHLO_REDUCE = 174
STABLEHLO_ABS = 175
STABLEHLO_AND = 176
STABLEHLO_COSINE = 177
STABLEHLO_EXPONENTIAL = 178
STABLEHLO_FLOOR = 179
STABLEHLO_LOG = 180
STABLEHLO_MINIMUM = 181
STABLEHLO_NEGATE = 182
STABLEHLO_OR = 183
STABLEHLO_POWER = 184
STABLEHLO_REMAINDER = 185
STABLEHLO_RSQRT = 186
STABLEHLO_SELECT = 187
STABLEHLO_SUBTRACT = 188
STABLEHLO_TANH = 189
# automatically generated by the FlatBuffers compiler, do not modify

# namespace: tflite
Expand Down
15 changes: 15 additions & 0 deletions tensorflow/lite/schema/schema.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,21 @@ enum BuiltinOperator : int32 {
STABLEHLO_SLICE = 172, // WARNING: No runtime support
STABLEHLO_CUSTOM_CALL = 173, // WARNING: No runtime support
STABLEHLO_REDUCE = 174, // WARNING: No runtime support
STABLEHLO_ABS = 175, // WARNING: No runtime support
STABLEHLO_AND = 176, // WARNING: No runtime support
STABLEHLO_COSINE = 177, // WARNING: No runtime support
STABLEHLO_EXPONENTIAL = 178, // WARNING: No runtime support
STABLEHLO_FLOOR = 179, // WARNING: No runtime support
STABLEHLO_LOG = 180, // WARNING: No runtime support
STABLEHLO_MINIMUM = 181, // WARNING: No runtime support
STABLEHLO_NEGATE = 182, // WARNING: No runtime support
STABLEHLO_OR = 183, // WARNING: No runtime support
STABLEHLO_POWER = 184, // WARNING: No runtime support
STABLEHLO_REMAINDER = 185, // WARNING: No runtime support
STABLEHLO_RSQRT = 186, // WARNING: No runtime support
STABLEHLO_SELECT = 187, // WARNING: No runtime support
STABLEHLO_SUBTRACT = 188, // WARNING: No runtime support
STABLEHLO_TANH = 189, // WARNING: No runtime support
}
// LINT.ThenChange(nnapi_linter/linter.proto)

Expand Down
55 changes: 50 additions & 5 deletions tensorflow/lite/schema/schema_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -1111,11 +1111,26 @@ enum BuiltinOperator : int32_t {
BuiltinOperator_STABLEHLO_SLICE = 172,
BuiltinOperator_STABLEHLO_CUSTOM_CALL = 173,
BuiltinOperator_STABLEHLO_REDUCE = 174,
BuiltinOperator_STABLEHLO_ABS = 175,
BuiltinOperator_STABLEHLO_AND = 176,
BuiltinOperator_STABLEHLO_COSINE = 177,
BuiltinOperator_STABLEHLO_EXPONENTIAL = 178,
BuiltinOperator_STABLEHLO_FLOOR = 179,
BuiltinOperator_STABLEHLO_LOG = 180,
BuiltinOperator_STABLEHLO_MINIMUM = 181,
BuiltinOperator_STABLEHLO_NEGATE = 182,
BuiltinOperator_STABLEHLO_OR = 183,
BuiltinOperator_STABLEHLO_POWER = 184,
BuiltinOperator_STABLEHLO_REMAINDER = 185,
BuiltinOperator_STABLEHLO_RSQRT = 186,
BuiltinOperator_STABLEHLO_SELECT = 187,
BuiltinOperator_STABLEHLO_SUBTRACT = 188,
BuiltinOperator_STABLEHLO_TANH = 189,
BuiltinOperator_MIN = BuiltinOperator_ADD,
BuiltinOperator_MAX = BuiltinOperator_STABLEHLO_REDUCE
BuiltinOperator_MAX = BuiltinOperator_STABLEHLO_TANH
};

inline const BuiltinOperator (&EnumValuesBuiltinOperator())[175] {
inline const BuiltinOperator (&EnumValuesBuiltinOperator())[190] {
static const BuiltinOperator values[] = {
BuiltinOperator_ADD,
BuiltinOperator_AVERAGE_POOL_2D,
Expand Down Expand Up @@ -1291,13 +1306,28 @@ inline const BuiltinOperator (&EnumValuesBuiltinOperator())[175] {
BuiltinOperator_STABLEHLO_CONVOLUTION,
BuiltinOperator_STABLEHLO_SLICE,
BuiltinOperator_STABLEHLO_CUSTOM_CALL,
BuiltinOperator_STABLEHLO_REDUCE
BuiltinOperator_STABLEHLO_REDUCE,
BuiltinOperator_STABLEHLO_ABS,
BuiltinOperator_STABLEHLO_AND,
BuiltinOperator_STABLEHLO_COSINE,
BuiltinOperator_STABLEHLO_EXPONENTIAL,
BuiltinOperator_STABLEHLO_FLOOR,
BuiltinOperator_STABLEHLO_LOG,
BuiltinOperator_STABLEHLO_MINIMUM,
BuiltinOperator_STABLEHLO_NEGATE,
BuiltinOperator_STABLEHLO_OR,
BuiltinOperator_STABLEHLO_POWER,
BuiltinOperator_STABLEHLO_REMAINDER,
BuiltinOperator_STABLEHLO_RSQRT,
BuiltinOperator_STABLEHLO_SELECT,
BuiltinOperator_STABLEHLO_SUBTRACT,
BuiltinOperator_STABLEHLO_TANH
};
return values;
}

inline const char * const *EnumNamesBuiltinOperator() {
static const char * const names[176] = {
static const char * const names[191] = {
"ADD",
"AVERAGE_POOL_2D",
"CONCATENATION",
Expand Down Expand Up @@ -1473,13 +1503,28 @@ inline const char * const *EnumNamesBuiltinOperator() {
"STABLEHLO_SLICE",
"STABLEHLO_CUSTOM_CALL",
"STABLEHLO_REDUCE",
"STABLEHLO_ABS",
"STABLEHLO_AND",
"STABLEHLO_COSINE",
"STABLEHLO_EXPONENTIAL",
"STABLEHLO_FLOOR",
"STABLEHLO_LOG",
"STABLEHLO_MINIMUM",
"STABLEHLO_NEGATE",
"STABLEHLO_OR",
"STABLEHLO_POWER",
"STABLEHLO_REMAINDER",
"STABLEHLO_RSQRT",
"STABLEHLO_SELECT",
"STABLEHLO_SUBTRACT",
"STABLEHLO_TANH",
nullptr
};
return names;
}

inline const char *EnumNameBuiltinOperator(BuiltinOperator e) {
if (flatbuffers::IsOutRange(e, BuiltinOperator_ADD, BuiltinOperator_STABLEHLO_REDUCE)) return "";
if (flatbuffers::IsOutRange(e, BuiltinOperator_ADD, BuiltinOperator_STABLEHLO_TANH)) return "";
const size_t index = static_cast<size_t>(e);
return EnumNamesBuiltinOperator()[index];
}
Expand Down

0 comments on commit c795f31

Please sign in to comment.