| 5026 | |
| 5027 | @property |
| 5028 | def _gpu_stream_stack(self): |
| 5029 | if self._stack_state_is_thread_local: |
| 5030 | # This may be called from a thread where device_function_stack doesn't yet |
| 5031 | # exit. |
| 5032 | if not hasattr(self._thread_local, "_gpu_stream_stack"): |
| 5033 | stack_copy_for_this_thread = self._graph_gpu_stream_stack.copy() |
| 5034 | self._thread_local._gpu_stream_stack = stack_copy_for_this_thread |
| 5035 | return self._thread_local._gpu_stream_stack |
| 5036 | else: |
| 5037 | return self._graph_gpu_stream_stack |
| 5038 | |
| 5039 | @property |
| 5040 | def _colocation_stack(self): |