r"""Check whether input contains infinite or nan value. Args: inps: tensors to be checked. Returns: a int32 scalar tensor, 0 for False and 1 for True.
(inps: Iterable[Tensor], scale=1.0)
| 1002 | |
| 1003 | |
| 1004 | def _check_non_finite(inps: Iterable[Tensor], scale=1.0) -> Tensor: |
| 1005 | r"""Check whether input contains infinite or nan value. |
| 1006 | |
| 1007 | Args: |
| 1008 | inps: tensors to be checked. |
| 1009 | |
| 1010 | Returns: |
| 1011 | a int32 scalar tensor, 0 for False and 1 for True. |
| 1012 | """ |
| 1013 | if isinstance(inps, Tensor): |
| 1014 | inps = [inps] |
| 1015 | op = builtin.CheckNonFinite(scale=scale) |
| 1016 | oups = apply(op, *inps) |
| 1017 | out = oups[-1] |
| 1018 | for i in range(len(inps)): |
| 1019 | inps[i]._reset(oups[i]) |
| 1020 | |
| 1021 | return out |
no test coverage detected