MCPcopy Create free account
hub / github.com/apache/tvm-ffi / __enter__

Method __enter__

python/tvm_ffi/stream.py:57–62  ·  view source on GitHub ↗

Enter the context and set the current stream.

(self)

Source from the content-addressed store, hash-verified

55 self.stream = stream
56
57 def __enter__(self) -> StreamContext:
58 """Enter the context and set the current stream."""
59 self.prev_stream = core._env_set_current_stream(
60 self.device_type, self.device_id, self.stream
61 )
62 return self
63
64 def __exit__(self, *args: Any) -> None:
65 """Exit the context and restore the previous stream."""

Callers 1

__enter__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected