Added extra documentation to python installation and dependencies

This commit is contained in:
Alejandro Saucedo 2020-11-12 20:25:10 +00:00
parent 69127702fc
commit 5631c9c88e
2 changed files with 15 additions and 0 deletions

1
.gitmodules vendored
View file

@ -13,3 +13,4 @@
[submodule "python/pybind11"]
path = python/pybind11
url = https://github.com/pybind/pybind11
branch = v2.6.1

View file

@ -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),