def enable_predicates(enable: bool = True):
  """Turn on or off whether predicates (`RequireTrue`/`EnsureTrue`) are used.

  Enabled by default, but can be disabled to ensure we aren't doing any
  extraneous compute during graph evaluation time. Lambdas can also sometimes
  cause problems when Autograph is trying to convert trace functions within
  a `tf.data.map`.

  Args:
    enable: Whether or not to enable predicates.
  """
  global _predicates_enabled
  _predicates_enabled = enable
Turn on or off whether predicates (`RequireTrue`/`EnsureTrue`) are used.

  Enabled by default, but can be disabled to ensure we aren't doing any
  extraneous compute during graph evaluation time. Lambdas can also sometimes
  cause problems when Autograph is trying to convert trace functions within
  a `tf.data.map`.

  Args:
    enable: Whether or not to enable predicates.
  
language/canine/tensor_contracts.py