提交 02b6e413 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

numpydoc for theano/scan_module/scan_views.py

上级 b7cf7933
""" """
This module provides syntax shortcut for the Scan Op This module provides syntax shortcut for the Scan Op.
See scan.py for details on scan See scan.py for details on scan.
"""
"""
__docformat__ = 'restructedtext en' __docformat__ = 'restructedtext en'
__authors__ = ("Razvan Pascanu " __authors__ = ("Razvan Pascanu "
"Frederic Bastien " "Frederic Bastien "
...@@ -37,26 +37,27 @@ def map(fn, ...@@ -37,26 +37,27 @@ def map(fn,
""" """
Similar behaviour as python's map. Similar behaviour as python's map.
:param fn: The function that ``map`` applies at each iteration step Parameters
(see ``scan`` for more info). ----------
fn
:param sequences: List of sequences over which ``map`` iterates The function that ``map`` applies at each iteration step
(see ``scan`` for more info). (see ``scan`` for more info).
sequences
:param non_sequences: List of arguments passed to ``fn``. ``map`` will List of sequences over which ``map`` iterates
not iterate over these arguments (see ``scan`` for (see ``scan`` for more info).
more info). non_sequences
List of arguments passed to ``fn``. ``map`` will not iterate over
:param truncate_gradient: See ``scan``. these arguments (see ``scan`` for more info).
truncate_gradient
:param go_backwards: Boolean value that decides the direction of See ``scan``.
iteration. True means that sequences are parsed go_backwards : bool
from the end towards the begining, while False Decides the direction of iteration. True means that sequences are parsed
is the other way around. from the end towards the begining, while False is the other way around.
mode
See ``scan``.
name
See ``scan``.
:param mode: See ``scan``.
:param name: See ``scan``.
""" """
return scan(fn=fn, return scan(fn=fn,
sequences=sequences, sequences=sequences,
...@@ -77,29 +78,31 @@ def reduce(fn, ...@@ -77,29 +78,31 @@ def reduce(fn,
mode=None, mode=None,
name=None): name=None):
""" """
Similar behaviour as python's reduce Similar behaviour as python's reduce.
:param fn: The function that ``reduce`` applies at each iteration step Parameters
(see ``scan`` for more info). ----------
fn
:param sequences: List of sequences over which ``reduce`` iterates The function that ``reduce`` applies at each iteration step
(see ``scan`` for more info) (see ``scan`` for more info).
sequences
:param outputs_info: List of dictionaries describing the outputs of List of sequences over which ``reduce`` iterates
reduce (see ``scan`` for more info). (see ``scan`` for more info).
outputs_info
:param non_sequences: List of arguments passed to ``fn``. ``reduce`` will List of dictionaries describing the outputs of
reduce (see ``scan`` for more info).
non_sequences
List of arguments passed to ``fn``. ``reduce`` will
not iterate over these arguments (see ``scan`` for not iterate over these arguments (see ``scan`` for
more info). more info).
go_backwards : bool
Decides the direction of iteration. True means that sequences are parsed
from the end towards the begining, while False is the other way around.
mode
See ``scan``.
name
See ``scan``.
:param go_backwards: Boolean value that decides the direction of
iteration. True means that sequences are parsed
from the end towards the begining, while False
is the other way around.
:param mode: See ``scan``.
:param name: See ``scan``.
""" """
rval = scan(fn=fn, rval = scan(fn=fn,
sequences=sequences, sequences=sequences,
...@@ -123,25 +126,27 @@ def foldl(fn, ...@@ -123,25 +126,27 @@ def foldl(fn,
mode=None, mode=None,
name=None): name=None):
""" """
Similar behaviour as haskell's foldl Similar behaviour as haskell's foldl.
:param fn: The function that ``foldl`` applies at each iteration step Parameters
(see ``scan`` for more info). ----------
fn
The function that ``foldl`` applies at each iteration step
(see ``scan`` for more info).
sequences
List of sequences over which ``foldl`` iterates
(see ``scan`` for more info).
outputs_info
List of dictionaries describing the outputs of reduce
(see ``scan`` for more info).
non_sequences
List of arguments passed to `fn`. ``foldl`` will not iterate over
these arguments (see ``scan`` for more info).
mode
See ``scan``.
name
See ``scan``.
:param sequences: List of sequences over which ``foldl`` iterates
(see ``scan`` for more info)
:param outputs_info: List of dictionaries describing the outputs of
reduce (see ``scan`` for more info).
:param non_sequences: List of arguments passed to `fn`. ``foldl`` will
not iterate over these arguments (see ``scan`` for
more info).
:param mode: See ``scan``.
:param name: See ``scan``.
""" """
return reduce(fn=fn, return reduce(fn=fn,
sequences=sequences, sequences=sequences,
...@@ -160,25 +165,27 @@ def foldr(fn, ...@@ -160,25 +165,27 @@ def foldr(fn,
mode=None, mode=None,
name=None): name=None):
""" """
Similar behaviour as haskell' foldr Similar behaviour as haskell' foldr.
:param fn: The function that ``foldr`` applies at each iteration step Parameters
(see ``scan`` for more info). ----------
fn
The function that ``foldr`` applies at each iteration step
:param sequences: List of sequences over which ``foldr`` iterates (see ``scan`` for more info).
(see ``scan`` for more info) sequences
List of sequences over which ``foldr`` iterates
:param outputs_info: List of dictionaries describing the outputs of (see ``scan`` for more info).
reduce (see ``scan`` for more info). outputs_info
List of dictionaries describing the outputs of reduce
:param non_sequences: List of arguments passed to `fn`. ``foldr`` will (see ``scan`` for more info).
not iterate over these arguments (see ``scan`` for non_sequences
more info). List of arguments passed to `fn`. ``foldr`` will not iterate over these
arguments (see ``scan`` for more info).
:param mode: See ``scan``. mode
See ``scan``.
name
See ``scan``.
:param name: See ``scan``.
""" """
return reduce(fn=fn, return reduce(fn=fn,
sequences=sequences, sequences=sequences,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论