mirror of
https://github.com/zebrajr/tensorflow.git
synced 2026-01-15 12:15:41 +00:00
Allow passing printf style arguments to the TF_LITE_ENSURE_MSG macro.
PiperOrigin-RevId: 578246535
This commit is contained in:
committed by
TensorFlower Gardener
parent
5719b62d85
commit
e5487031e1
@@ -201,12 +201,12 @@ void TfLiteFloatArrayFree(TfLiteFloatArray* a);
|
||||
|
||||
// Check whether value is true, and if not return kTfLiteError from
|
||||
// the current function (and report the error string msg).
|
||||
#define TF_LITE_ENSURE_MSG(context, value, msg) \
|
||||
do { \
|
||||
if (!(value)) { \
|
||||
TF_LITE_KERNEL_LOG((context), __FILE__ " " msg); \
|
||||
return kTfLiteError; \
|
||||
} \
|
||||
#define TF_LITE_ENSURE_MSG(context, value, ...) \
|
||||
do { \
|
||||
if (!(value)) { \
|
||||
TF_LITE_KERNEL_LOG((context), __FILE__ " " __VA_ARGS__); \
|
||||
return kTfLiteError; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
// Check whether the value `a` is true, and if not return kTfLiteError from
|
||||
|
||||
Reference in New Issue
Block a user