Return true iff op has real gradient.
(grads, op)
| 757 | |
| 758 | |
| 759 | def _HasAnyNotNoneGrads(grads, op): |
| 760 | """Return true iff op has real gradient.""" |
| 761 | out_grads = _GetGrads(grads, op) |
| 762 | for out_grad in out_grads: |
| 763 | if isinstance(out_grad, (ops.Tensor, ops.IndexedSlices)): |
| 764 | return True |
| 765 | if out_grad and isinstance(out_grad, collections_abc.Sequence): |
| 766 | if any(g is not None for g in out_grad): |
| 767 | return True |
| 768 | return False |
| 769 | |
| 770 | |
| 771 | def _UpdatePendingAndEnqueueReady(grads, op, queue, pending_count, loop_state, |
no test coverage detected