提交 1efb1539 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Merge pull request #4335 from fvisin/fix_elemwise

Check RST files in '/theano/doc/' to follow numpy's docstring + Fix elemwise
差异被折叠。
...@@ -875,43 +875,12 @@ Modify and execute to compute: numpy.add and numpy.subtract. ...@@ -875,43 +875,12 @@ Modify and execute to compute: numpy.add and numpy.subtract.
Modify and execute the example to return two outputs: x + y Modify and execute the example to return two outputs: x + y
and x - y. and x - y.
.. _Documentation:
Documentation Documentation and Coding Style
------------- ------------------------------
Please always respect the :ref:`quality_contributions` or your contribution
See :ref:`metadocumentation`, for some information on how to generate will not be accepted.
the documentation.
Here is an example how to add docstring to a class.
.. testcode:: python
import theano
class DoubleOp(theano.Op):
""" Double each element of a tensor.
:param x: input tensor.
:return: a tensor of the same shape and dtype as the input with all
values doubled.
:note:
this is a test note
:seealso:
You can use the elemwise op to replace this example.
Just execute `x * 2` with x being a Theano variable.
.. versionadded:: 0.6
"""
This is how it will show up for files that we auto-list in the library
documentation:
.. automodule:: theano.misc.doubleop
:members:
NanGuardMode and AllocEmpty NanGuardMode and AllocEmpty
--------------------------- ---------------------------
......
===================================================================
:mod:`tensor.elemwise` -- Tensor Elemwise
===================================================================
.. testsetup::
from theano.tensor.elemwise import *
.. module:: tensor.elemwise
:platform: Unix, Windows
:synopsis: Tensor Elemwise
.. moduleauthor:: LISA
.. automodule:: theano.tensor.elemwise
:members:
...@@ -23,6 +23,7 @@ They are grouped into the following sections: ...@@ -23,6 +23,7 @@ They are grouped into the following sections:
shared_randomstreams shared_randomstreams
signal/index signal/index
utils utils
elemwise
extra_ops extra_ops
io io
opt opt
......
...@@ -5,19 +5,29 @@ import theano ...@@ -5,19 +5,29 @@ import theano
class DoubleOp(theano.Op): class DoubleOp(theano.Op):
""" Double each element of a tensor. """
Double each element of a tensor.
:param x: input tensor. Parameters
----------
x : tensor
Input tensor
:return: a tensor of the same shape and dtype as the input with all Returns
-------
tensor
a tensor of the same shape and dtype as the input with all
values doubled. values doubled.
:note: Notes
-----
this is a test note this is a test note
:seealso: See Also
You can use the elemwise op to replace this example. --------
Just execute `x * 2` with x being a Theano variable. :class:`~theano.tensor.elemwise.Elemwise` : You can use this to replace
this example. Just execute `x * 2` with x being a Theano variable.
.. versionadded:: 0.6 .. versionadded:: 0.6
""" """
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论