提交 f7e152fc authored 作者: Iban Harlouchet's avatar Iban Harlouchet

Added doc on mgrid and ogrid in doc/library/tensor/basic.txt

上级 347fdf62
......@@ -1643,28 +1643,49 @@ Linear Algebra
:note: See :func:`tensordot` and :func:`batched_dot` for
supplementary documentation.
.. function:: mgrid()
:param
:returns: a dense (or fleshed out) mesh-grid when indexed, so that
each returned argument has the same shape. The dimensions
and number of the output arrays are equal to the number of
indexing dimensions. If the step length is not a complex
number, then the stop is not inclusive.
.. function:: mgrid
.. function:: ogrid()
:returns: an instance which returns a dense (or fleshed out) mesh-grid
when indexed, so that each returned argument has the same shape.
The dimensions and number of the output arrays are equal to the
number of indexing dimensions. If the step length is not a complex
number, then the stop is not inclusive.
:param
:returns: an open (i.e. not fleshed out) mesh-grid when indexed,
so that only one dimension of each returned array is
greater than 1. The dimension and number of the output
arrays are equal to the number of indexing dimensions.
If the step length is not a complex number, then the
stop is not inclusive.
Example:
>>> a = T.mgrid[0:5, 0:3]
>>> a[0].eval()
array([[0, 0, 0],
[1, 1, 1],
[2, 2, 2],
[3, 3, 3],
[4, 4, 4]], dtype=int8)
>>> a[1].eval()
array([[0, 1, 2],
[0, 1, 2],
[0, 1, 2],
[0, 1, 2],
[0, 1, 2]], dtype=int8)
.. function:: ogrid
:returns: an instance which returns an open (i.e. not fleshed out) mesh-grid
when indexed, so that only one dimension of each returned array is
greater than 1. The dimension and number of the output arrays are
equal to the number of indexing dimensions. If the step length is
not a complex number, then the stop is not inclusive.
Example:
>>> b = T.ogrid[0:5, 0:3]
>>> b[0].eval()
array([[0],
[1],
[2],
[3],
[4]], dtype=int8)
>>> b[1].eval()
array([[0, 1, 2, 3]], dtype=int8)
Gradient / Differentiation
==========================
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论