Added extra documentation to python installation and dependencies
This commit is contained in:
parent
69127702fc
commit
5631c9c88e
2 changed files with 15 additions and 0 deletions
|
|
@ -52,6 +52,11 @@ More specifically, it can be through the following functions:
|
|||
* mgr.eval_async_<opname>_def - Runs operation asynchronously under a new anonymous sequence
|
||||
* seq.record_<opname> - Records operation in sequence (requires sequence to be in recording mode)
|
||||
|
||||
Python Examples
|
||||
=========
|
||||
|
||||
Below we cover a broad set of examples. These use the ```pyshader``` dependency, which you can install with `pip install pyshader`.
|
||||
|
||||
Python Example (Simple)
|
||||
^^^^^
|
||||
|
||||
|
|
@ -60,6 +65,9 @@ Then you can interact with it from your interpreter. Below is the same sample as
|
|||
.. code-block:: python
|
||||
:linenos:
|
||||
|
||||
from kp import Manager, Tensor
|
||||
from pyshader import python2shader, ivec3, f32, Array
|
||||
|
||||
mgr = Manager()
|
||||
|
||||
# Can be initialized with List[] or np.Array
|
||||
|
|
@ -101,6 +109,9 @@ Similarly you can find the same extended example as above:
|
|||
.. code-block:: python
|
||||
:linenos:
|
||||
|
||||
from kp import Manager, Tensor
|
||||
from pyshader import python2shader, ivec3, f32, Array
|
||||
|
||||
mgr = Manager(0, [2])
|
||||
|
||||
# Can be initialized with List[] or np.Array
|
||||
|
|
@ -190,6 +201,9 @@ Similar to the logistic regression implementation in the C++ examples section, b
|
|||
.. code-block:: python
|
||||
:linenos:
|
||||
|
||||
from kp import Manager, Tensor
|
||||
from pyshader import python2shader, ivec3, f32, Array
|
||||
|
||||
@python2shader
|
||||
def compute_shader(
|
||||
index = ("input", "GlobalInvocationId", ivec3),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue