MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _show_max_abs

Method _show_max_abs

tensorflow/python/tpu/tensor_tracer.py:597–604  ·  view source on GitHub ↗
(tensor)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 4

maximumMethod · 0.80
reshapeMethod · 0.80
castMethod · 0.45
constantMethod · 0.45

Tested by

no test coverage detected