parameters: (self)
return_statement: return True
docstring: Returns false incase it is not safe to trace ops in tf.cond or tf.while_loop.
docstring_summary: Returns false incase it is not safe to trace ops in tf.cond or tf.while_loop.
docstring_tokens: Returns false incase it is not safe to trace ops in tf . cond or tf . while_loop .
function: def _should_trace_in_control_flow(self):
      """Returns false incase it is not safe to trace ops in tf.cond or tf.while_loop."""
      # As different from the other trace modes, TRACE_MODE_OPTIONAL_SUMMARY
      # forces the execution of the traced tensors. We should not trace the ops
      # that may not be executed due to control flow.
      if self._use_temp_cache():
        return False
      elif self._tt_config.device_type == _DEVICE_TYPE_TPU:
        # On TPUs do not trace in control flow unless we use caches to store
        # intermediate values as calling outside compilation within an inner loop
        # causes errors.
        return self._use_tensor_values_cache() or self._use_tensor_buffer()
      return True
function_tokens: def _should_trace_in_control_flow ( self ) : # As different from the other trace modes, TRACE_MODE_OPTIONAL_SUMMARY # forces the execution of the traced tensors. We should not trace the ops # that may not be executed due to control flow. if self . _use_temp_cache ( ) : return False elif self . _tt_config . device_type == _DEVICE_TYPE_TPU : # On TPUs do not trace in control flow unless we use caches to store # intermediate values as calling outside compilation within an inner loop # causes errors. return self . _use_tensor_values_cache ( ) or self . _use_tensor_buffer ( ) return True