(g)
| 531 | grad = _BroadcastMul(grad_loss, softmax_grad) |
| 532 | |
| 533 | def IsZero(g): |
| 534 | # Some introspection to check if the gradient is feeding zeros |
| 535 | if context.executing_eagerly(): |
| 536 | # TODO(apassos) add an efficient way to detect eager zeros here. |
| 537 | return False |
| 538 | if g.op.type in ("ZerosLike", "Zeros"): |
| 539 | return True |
| 540 | const_fill_value = tensor_util.constant_value(g) |
| 541 | return const_fill_value is not None and (const_fill_value == 0).all() |
| 542 | |
| 543 | logits = op.inputs[0] |
| 544 | if grad_grad is not None and not IsZero(grad_grad): |
no test coverage detected