Make array conform to the Python Buffer Protocol (#323)

This commit is contained in:
Daniel Strobusch
2024-01-06 00:58:33 +01:00
committed by GitHub
parent dfdb284e16
commit 1331fa19f6
10 changed files with 343 additions and 109 deletions

View File

@@ -0,0 +1,18 @@
.. _using_streams:
Using Streams
=============
.. currentmodule:: mlx.core
Specifying the :obj:`Stream`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All operations (including random number generation) take an optional
keyword argument ``stream``. The ``stream`` kwarg specifies which
:obj:`Stream` the operation should run on. If the stream is unspecified then
the operation is run on the default stream of the default device:
``mx.default_stream(mx.default_device())``. The ``stream`` kwarg can also
be a :obj:`Device` (e.g. ``stream=my_device``) in which case the operation is
run on the default stream of the provided device
``mx.default_stream(my_device)``.