Skip to content

Commit

Permalink
Automated sync from github.com/tensorflow/tensorflow (#2177)
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 18, 2023
1 parent 3bd11ea commit 389d8f5
Show file tree
Hide file tree
Showing 7 changed files with 2,265 additions and 14 deletions.
6 changes: 6 additions & 0 deletions tensorflow/lite/builtin_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ typedef enum {
kTfLiteBuiltinStablehloDivide = 164,
kTfLiteBuiltinStablehloMultiply = 165,
kTfLiteBuiltinStablehloMaximum = 166,
kTfLiteBuiltinStablehloReshape = 167,
kTfLiteBuiltinStablehloClamp = 168,
kTfLiteBuiltinStablehloConcatenate = 169,
kTfLiteBuiltinStablehloBroadcastInDim = 170,
kTfLiteBuiltinStablehloConvolution = 171,
kTfLiteBuiltinStablehloSlice = 172,
} TfLiteBuiltinOperator;

#ifdef __cplusplus
Expand Down
6 changes: 3 additions & 3 deletions tensorflow/lite/core/api/error_reporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class ErrorReporter {
// reduce binary size, define TF_LITE_STRIP_ERROR_STRINGS when compiling and
// every call will be stubbed out, taking no memory.
#ifndef TF_LITE_STRIP_ERROR_STRINGS
#define TF_LITE_REPORT_ERROR(reporter, ...) \
do { \
static_cast<tflite::ErrorReporter*>(reporter)->Report(__VA_ARGS__); \
#define TF_LITE_REPORT_ERROR(reporter, ...) \
do { \
static_cast<::tflite::ErrorReporter*>(reporter)->Report(__VA_ARGS__); \
} while (false)
#else // TF_LITE_STRIP_ERROR_STRINGS
#define TF_LITE_REPORT_ERROR(reporter, ...)
Expand Down
8 changes: 8 additions & 0 deletions tensorflow/lite/core/api/flatbuffer_conversions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,11 @@ TfLiteStatus ParseOpDataTfLite(const Operator* op, BuiltinOperator op_type,
return kTfLiteOk;
}

// TODO: skip param parsing for now since ops below don't have kernels
case BuiltinOperator_STABLEHLO_SLICE:
case BuiltinOperator_STABLEHLO_BROADCAST_IN_DIM:
case BuiltinOperator_STABLEHLO_CONVOLUTION:

// Below are the ops with no builtin_data structure.
// TODO(aselle): Implement call in BuiltinOptions, but nullptrs are
// ok for now, since there is no call implementation either.
Expand Down Expand Up @@ -904,6 +909,9 @@ TfLiteStatus ParseOpDataTfLite(const Operator* op, BuiltinOperator op_type,
case BuiltinOperator_STABLEHLO_DIVIDE:
case BuiltinOperator_STABLEHLO_MULTIPLY:
case BuiltinOperator_STABLEHLO_MAXIMUM:
case BuiltinOperator_STABLEHLO_RESHAPE:
case BuiltinOperator_STABLEHLO_CLAMP:
case BuiltinOperator_STABLEHLO_CONCATENATE:
return kTfLiteOk;
case BuiltinOperator_PLACEHOLDER_FOR_GREATER_OP_CODES:
return kTfLiteError;
Expand Down
4 changes: 4 additions & 0 deletions tensorflow/lite/core/c/builtin_op_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,10 @@ typedef struct {
bool approximate;
} TfLiteGeluParams;

typedef struct {
int64_t dimension;
} TfLiteStablehloConcatenateParams;

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
Expand Down
Loading

0 comments on commit 389d8f5

Please sign in to comment.