Stream
- class Stream(auto_yield: bool = True)
Represents a stream that is used by the module for inference.
Notes
When creating a
Streamobject, the actual stream is not instantiated immediately. This object is initialized only whentcim_lite.runtime.Module.set_stream()is called with theStreamobject. This deferred instantiation allows for more efficient resource allocation during the model loading process.Examples
import tcim_lite as tcim # Create a stream and set the stream to the module stream = tcim.runtime.Stream() module.set_stream(stream) # Synchronize the stream stream.sync() # Sync and yield the stream stream.sync_yield() # Destroy the stream immediately, it can also be destroyed automatically del stream
Constructor for the Stream class.
- Parameters:
auto_yield (bool) -- Specifies if to automatically release IPU core resources after all tasks in the stream are completed. Defaults to
True.
Methods
Constructor for the Stream class.
Waits for all tasks in the stream to complete.
Releases the IPU core resources that is used by the stream.