(ctx, *args: Union[HLOTensor, Sequence[HLOTensor]])
| 558 | |
| 559 | @register_lower_rule(mops.CheckNonFinite) |
| 560 | def checknonfinite_lower(ctx, *args: Union[HLOTensor, Sequence[HLOTensor]]): |
| 561 | check_inf = [logical_or(isnan(arg), isinf(arg)) for arg in args] |
| 562 | check_inf_reduce = [expand_dims(sum(inp), 0) for inp in check_inf] |
| 563 | concat_res = concat(check_inf_reduce, 0) |
| 564 | if_nonfinite = expand_dims(sum(concat_res), 0).astype(np.int32) |
| 565 | res = [arg * ctx.op.scale for arg in args] |
| 566 | res.append(if_nonfinite) |
| 567 | return res |
nothing calls this directly
no test coverage detected