提交 cb3edced authored 作者: Frederic's avatar Frederic

fix typo and better formulation following code review.

上级 a52012e5
...@@ -20,19 +20,19 @@ Inputs and Outputs are lists of Theano variables ...@@ -20,19 +20,19 @@ Inputs and Outputs are lists of Theano variables
.. note:: .. note::
This tutorial do not cover how to make an op that return a view or This tutorial does not cover how to make an op that returns a view or
modify the values in it's inputs. So all modify the values in its inputs. So all
Op done with the instruction here MUST return newly allocated Ops created with the instructions here MUST return newly allocated
memory or reuse the memory provided in the parameter memory or reuse the memory provided in the parameter
output_storage of the :func:`perform` function. See :ref:`views_and_inplace` output_storage of the :func:`perform` function. See :ref:`views_and_inplace`
for explanation of how to do this. for explanation of how to do this.
If your Op return a view or change the value in its inputs If your Op returns a view or change the value on its inputs
without doing as said in that page, Theano will run, but will without doing as said in that page, Theano will run, but will
return good results some graph, but bad results for others. return good results for some graphs, but bad results for others.
It is recommented that you run your tests in DebugMode (Theano flag It is recommented that you run your tests in DebugMode (Theano flag
mode=DebugMode) that check if your Op behave correctly in this mode=DebugMode) that checks if your Op behaves correctly in this
regard. regard.
.. note:: .. note::
...@@ -291,11 +291,12 @@ To verify the Rop method of the DoubleOp, you can use this: ...@@ -291,11 +291,12 @@ To verify the Rop method of the DoubleOp, you can use this:
Running your tests Running your tests
================== ==================
You can run ``nosetests`` in the Theano folder to run it as all You can run ``nosetests`` in the Theano folder to run all of Theano's
Theano's tests including yours if inside such directory. You can run tests, including yours if they are somewhere in the directory
``nosetests test_file.py`` to run only the tests in that file. You can structure. You can run ``nosetests test_file.py`` to run only the
run ``nosetests test_file.py:test_DoubleRop`` to run only the tests tests in that file. You can run ``nosetests
inside that test class. You can run ``nosetests test_file.py:test_DoubleRop`` to run only the tests inside that test
class. You can run ``nosetests
test_file.py:test_DoubleRop.test_double_op`` to run only one test_file.py:test_DoubleRop.test_double_op`` to run only one
particular test. More `nosetests particular test. More `nosetests
<http://readthedocs.org/docs/nose/en/latest/>`_ documentation. <http://readthedocs.org/docs/nose/en/latest/>`_ documentation.
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
Sparse Sparse
====== ======
This is a very short tutorial on sparse with Theano. There is still This is a very short tutorial on sparse matrices with Theano. There is still
some not well documented behavior like how we take care of the some not well documented behavior like how we take care of the
gradient. There is 2 types of gradient for sparse operation. ``full gradient. There are 2 types of gradient for sparse operations. ``full
gradient`` that compute a gradient for values even if they were 0 and gradient`` that compute a gradient for values even if they were 0 and
the ``structured gradient`` that returns a gradient only for values the ``structured gradient`` that returns a gradient only for values
that where not 0. You need to check the code to know witch gradient an that were not 0. You need to check the code to know which gradient an
op implement. Op implements.
More documentation in the :ref:`Sparse Library Reference <libdoc_sparse>`. More documentation in the :ref:`Sparse Library Reference <libdoc_sparse>`.
......
...@@ -6,7 +6,7 @@ from theano.gof.cc import hash_from_code ...@@ -6,7 +6,7 @@ from theano.gof.cc import hash_from_code
def hash_from_ndarray(data): def hash_from_ndarray(data):
"""Return a hash from an ndarray """Return a hash from an ndarray
It take care of the data, shapes, strides and dtype. It takes care of the data, shapes, strides and dtype.
""" """
# We need to hash the shapes and strides as hash_from_code only hashes # We need to hash the shapes and strides as hash_from_code only hashes
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论