(self)
| 523 | " this function with @tf.function.".format(task)) |
| 524 | |
| 525 | def _disallow_bool_casting(self): |
| 526 | if ag_ctx.control_status_ctx().status == ag_ctx.Status.DISABLED: |
| 527 | self._disallow_when_autograph_disabled( |
| 528 | "using a `tf.Tensor` as a Python `bool`") |
| 529 | elif ag_ctx.control_status_ctx().status == ag_ctx.Status.ENABLED: |
| 530 | self._disallow_when_autograph_enabled( |
| 531 | "using a `tf.Tensor` as a Python `bool`") |
| 532 | else: |
| 533 | # Default: V1-style Graph execution. |
| 534 | self._disallow_in_graph_mode("using a `tf.Tensor` as a Python `bool`") |
| 535 | |
| 536 | def _disallow_iteration(self): |
| 537 | if ag_ctx.control_status_ctx().status == ag_ctx.Status.DISABLED: |
no test coverage detected