提交 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.
Modify and execute the example to return two outputs: x + y
and x - y.
.. _Documentation:
Documentation
-------------
See :ref:`metadocumentation`, for some information on how to generate
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:
Documentation and Coding Style
------------------------------
Please always respect the :ref:`quality_contributions` or your contribution
will not be accepted.
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:
shared_randomstreams
signal/index
utils
elemwise
extra_ops
io
opt
......
......@@ -5,19 +5,29 @@ import theano
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.
:note:
this is a test note
Notes
-----
this is a test note
See Also
--------
:class:`~theano.tensor.elemwise.Elemwise` : You can use this to replace
this example. Just execute `x * 2` with x being a Theano variable.
:seealso:
You can use the elemwise op to replace this example.
Just execute `x * 2` with x being a Theano variable.
.. versionadded:: 0.6
"""
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论