From 5631c9c88e225a8809372fc24e2f103d083507f8 Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Thu, 12 Nov 2020 20:25:10 +0000 Subject: [PATCH] Added extra documentation to python installation and dependencies --- .gitmodules | 1 + docs/overview/python-package.rst | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.gitmodules b/.gitmodules index 33549db54..7b7ada44f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,4 @@ [submodule "python/pybind11"] path = python/pybind11 url = https://github.com/pybind/pybind11 + branch = v2.6.1 diff --git a/docs/overview/python-package.rst b/docs/overview/python-package.rst index e581f7a85..332bf3448 100644 --- a/docs/overview/python-package.rst +++ b/docs/overview/python-package.rst @@ -52,6 +52,11 @@ More specifically, it can be through the following functions: * mgr.eval_async__def - Runs operation asynchronously under a new anonymous sequence * seq.record_ - 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),