提交 c396b0ca authored 作者: Frederic Bastien's avatar Frederic Bastien

fix rst format.

上级 318b8758
...@@ -203,8 +203,8 @@ Inplace optimization and DebugMode ...@@ -203,8 +203,8 @@ Inplace optimization and DebugMode
It is recommended that during the graph construction, all op are not inplace. It is recommended that during the graph construction, all op are not inplace.
Then an optimization replace them with an inplace one. Currently DebugMode check Then an optimization replace them with an inplace one. Currently DebugMode check
all optimization that was tryed even if they got rejected. One reason an inplace all optimization that was tryed even if they got rejected. One reason an inplace
optimization can get rejected is that their is another op that already do an optimization can get rejected is that their is another op that already do an
inplace on the same input. A second reason to reject an inplace optimization is inplace on the same input. A second reason to reject an inplace optimization is
if it introduce cycle into the graph. if it introduce cycle into the graph.
......
...@@ -308,6 +308,7 @@ Windows V1(bigger install, but simpler instruction + try instruction for gpu) ...@@ -308,6 +308,7 @@ Windows V1(bigger install, but simpler instruction + try instruction for gpu)
in python run: in python run:
.. code-block:: bash .. code-block:: bash
import theano import theano
print theano.config.blas.ldflags print theano.config.blas.ldflags
...@@ -363,12 +364,14 @@ Windows V1(bigger install, but simpler instruction + try instruction for gpu) ...@@ -363,12 +364,14 @@ Windows V1(bigger install, but simpler instruction + try instruction for gpu)
directory contain those caractere, you must add in your configuration file: directory contain those caractere, you must add in your configuration file:
.. code-block:: bash .. code-block:: bash
[global] [global]
base_compiledir=PATH_TO_A_DIRECTORY_WITHOUT_THOSE_CARACTERE base_compiledir=PATH_TO_A_DIRECTORY_WITHOUT_THOSE_CARACTERE
You also need to add in the configuration file those line: You also need to add in the configuration file those line:
.. code-block:: bash .. code-block:: bash
[cuda] [cuda]
nvccflags=-LC:\Python26\libs nvccflags=-LC:\Python26\libs
......
...@@ -69,6 +69,7 @@ Failure ...@@ -69,6 +69,7 @@ Failure
Besides cleanup code, all code has access to the %(fail)s template. For three code blocks, the generated C code will pretty much look like this: Besides cleanup code, all code has access to the %(fail)s template. For three code blocks, the generated C code will pretty much look like this:
.. code-block:: CPP .. code-block:: CPP
int failure = 0; int failure = 0;
{ {
<code1> <code1>
...@@ -92,6 +93,7 @@ And %(fail)s in the nth code block will take the value "{failure = n; goto label ...@@ -92,6 +93,7 @@ And %(fail)s in the nth code block will take the value "{failure = n; goto label
When compiling an Op, we want to sync the outputs so we can get the results from Python. In case of failure, we will not necessarily want to sync. Because of that, typical code will look like this: When compiling an Op, we want to sync the outputs so we can get the results from Python. In case of failure, we will not necessarily want to sync. Because of that, typical code will look like this:
.. code-block:: CPP .. code-block:: CPP
int failure = 0; int failure = 0;
<declare input> <declare input>
<declare output> <declare output>
...@@ -144,6 +146,7 @@ Example Op ...@@ -144,6 +146,7 @@ Example Op
The following ResultBase represents addition of two nonnegative doubles (we only care about the C part). The following ResultBase represents addition of two nonnegative doubles (we only care about the C part).
.. code-block:: python .. code-block:: python
class Add(Op): class Add(Op):
<snip> <snip>
def c_var_names(self): def c_var_names(self):
...@@ -163,6 +166,7 @@ Generating a C function ...@@ -163,6 +166,7 @@ Generating a C function
For the example Op, the generated C function will typically look like this: For the example Op, the generated C function will typically look like this:
.. code-block:: python .. code-block:: python
void add(PyObject* storage_x, PyObject* storage_y, PyObject* storage_z) { void add(PyObject* storage_x, PyObject* storage_y, PyObject* storage_z) {
PyObject* py_x = PyList_GET_ITEM(storage_x, 0); Py_XINCREF(py_x); // automatic PyObject* py_x = PyList_GET_ITEM(storage_x, 0); Py_XINCREF(py_x); // automatic
PyObject* py_y = PyList_GET_ITEM(storage_y, 0); Py_XINCREF(py_y); // automatic PyObject* py_y = PyList_GET_ITEM(storage_y, 0); Py_XINCREF(py_y); // automatic
...@@ -215,6 +219,7 @@ To accelerate processing a tad, a struct can be generated instead of a function. ...@@ -215,6 +219,7 @@ To accelerate processing a tad, a struct can be generated instead of a function.
Here is a sketch of the struct equivalent of the previous function: Here is a sketch of the struct equivalent of the previous function:
.. code-block:: CPP .. code-block:: CPP
struct add { struct add {
PyObject* storage_x; PyObject* storage_x;
PyObject* storage_y; PyObject* storage_y;
......
...@@ -34,6 +34,7 @@ Question: does it make sense to apply the order to the loop, or is this broadcas ...@@ -34,6 +34,7 @@ Question: does it make sense to apply the order to the loop, or is this broadcas
Here is the loop for {{{order == c}}}. Check for errors! Here is the loop for {{{order == c}}}. Check for errors!
.. code-block:: CPP .. code-block:: CPP
<initialize iterators> <initialize iterators>
i1 = -1 i1 = -1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论