mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-06 12:20:11 +01:00
Merge pull request #49776 from geetachavan1/cherrypicks_H6RZ3
Prevent division by 0
This commit is contained in:
commit
371a2c5d71
|
|
@ -71,6 +71,10 @@ TfLiteStatus EvalSimple(TfLiteContext* context, TfLiteNode* node,
|
|||
const TfLiteTensor* lookup, const TfLiteTensor* value,
|
||||
TfLiteTensor* output) {
|
||||
const int row_size = SizeOfDimension(value, 0);
|
||||
if (row_size == 0) {
|
||||
// Propagate empty tensor if input is empty
|
||||
return kTfLiteOk;
|
||||
}
|
||||
const int row_bytes = value->bytes / row_size;
|
||||
|
||||
char* output_raw = GetTensorData<char>(output);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user