| 595 | return mean, var |
| 596 | |
| 597 | def _show_max_abs(tensor): |
| 598 | tensor = math_ops.cast(tensor, dtypes.float32) |
| 599 | output_tensor = math_ops.reduce_max(math_ops.abs(tensor)) |
| 600 | zero = constant_op.constant(0, dtypes.float32) |
| 601 | output_tensor = gen_math_ops.maximum(zero, output_tensor) |
| 602 | # The shape has to be 1. Set it if it does not have the information. |
| 603 | output_tensor = array_ops.reshape(output_tensor, [1]) |
| 604 | return output_tensor |
| 605 | |
| 606 | def _detect_inf_nan_producer(tensor): |
| 607 | """Checks if the tensor is the first NaN/Inf tensor in the computation path.""" |