Exit both Torch and FFI stream contexts.
(self, *args: Any)
| 90 | return self |
| 91 | |
| 92 | def __exit__(self, *args: Any) -> None: |
| 93 | """Exit both Torch and FFI stream contexts.""" |
| 94 | if self.torch_context: |
| 95 | self.torch_context.__exit__(*args) |
| 96 | self.ffi_context.__exit__(*args) |
| 97 | |
| 98 | def use_torch_stream(context: Any = None) -> TorchStreamContext: |
| 99 | """Create an FFI stream context with a Torch stream or graph. |