Retrieves the Scaffold from `captured_scaffold_fn`.
(captured_scaffold_fn)
| 555 | |
| 556 | |
| 557 | def _get_scaffold(captured_scaffold_fn): |
| 558 | """Retrieves the Scaffold from `captured_scaffold_fn`.""" |
| 559 | scaffold_fn = captured_scaffold_fn.get() |
| 560 | |
| 561 | if not scaffold_fn: |
| 562 | return None |
| 563 | |
| 564 | scaffold = scaffold_fn() |
| 565 | if scaffold is None: |
| 566 | raise ValueError( |
| 567 | 'TPUEstimatorSpec.scaffold_fn returns None, which is not allowed') |
| 568 | |
| 569 | return scaffold |
| 570 | |
| 571 | |
| 572 | def check_function_argument_count(func, input_arity, infeed_queue): |