A placeholder to capture an object.
| 31 | check_function_argument_count = xla.check_function_argument_count |
| 32 | |
| 33 | class _CapturedObject(object): |
| 34 | """A placeholder to capture an object.""" |
| 35 | |
| 36 | def __init__(self): |
| 37 | self._object = None |
| 38 | |
| 39 | def capture(self, o): |
| 40 | if self._object: |
| 41 | raise RuntimeError( |
| 42 | 'InternalError: _CapturedObject can capture only once. Please file ' |
| 43 | 'bug.') |
| 44 | |
| 45 | self._object = o |
| 46 | |
| 47 | def get(self): |
| 48 | return self._object |
| 49 | |
| 50 | |
| 51 | def _get_scaffold(captured_scaffold_fn): |
no outgoing calls
no test coverage detected