Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix FPE in inpace update ops.
PiperOrigin-RevId: 388303197
Change-Id: Ib48309b6213ffe53eba81004b00e889d653e4b83
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Aug 2, 2021
1 parent 29e3d6b commit e86605c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensorflow/core/kernels/inplace_ops.cc
Expand Up @@ -225,7 +225,7 @@ class InplaceOpBase : public OpKernel {

Tensor y = x; // This creates an alias intentionally.
// Skip processing if tensors are empty.
if (x.NumElements() > 0 || v.NumElements() > 0) {
if (x.NumElements() > 0 && v.NumElements() > 0) {
OP_REQUIRES_OK(ctx, DoCompute(ctx, i, v, &y));
}
ctx->set_output(0, y);
Expand Down

0 comments on commit e86605c

Please sign in to comment.