提交 4e7de4bb authored 作者: Frederic's avatar Frederic

fixed doc following code review.

上级 5708bccc
...@@ -149,7 +149,7 @@ List of Implemented Operations ...@@ -149,7 +149,7 @@ List of Implemented Operations
The grad implemented is regular. The grad implemented is regular.
- Transpose - Transpose
- :func:`Transpose <theano.sparse.basic.transpose>`. - :func:`transpose <theano.sparse.basic.transpose>`.
The grad implemented is regular. The grad implemented is regular.
- Basic Arithmetic - Basic Arithmetic
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
This is not in the released version 0.6.0, but will be in the next release (0.7 or 0.6.1). This is not in the released version 0.6.0, but will be in the next release (0.7 or 0.6.1).
This is a type that represent a list in Theano. All element must have This is a type that represents a list in Theano. All elements must have
the same Theano type. Here is an example:: the same Theano type. Here is an example::
import theano.typed_list import theano.typed_list
...@@ -20,8 +20,8 @@ the same Theano type. Here is an example:: ...@@ -20,8 +20,8 @@ the same Theano type. Here is an example::
print f([[1, 2, 3], [4, 5]], [2]) print f([[1, 2, 3], [4, 5]], [2])
#[array([ 1., 2., 3.], dtype=float32), array([ 4., 5.], dtype=float32), array([ 2.], dtype=float32)] #[array([ 1., 2., 3.], dtype=float32), array([ 4., 5.], dtype=float32), array([ 2.], dtype=float32)]
A second example with Scan. Scan don't have yet direct support of A second example with Scan. Scan doesn't yet have direct support of
TypedList, so you can only use it as non_sequences(not in sequences or TypedList, so you can only use it as non_sequences (not in sequences or
as outputs).:: as outputs).::
import theano.typed_list import theano.typed_list
......
...@@ -1112,8 +1112,8 @@ If you want to take only one element of a sparse matrix see ...@@ -1112,8 +1112,8 @@ If you want to take only one element of a sparse matrix see
The above indexing methods are not supported because the return value The above indexing methods are not supported because the return value
would be a sparse matrix rather than a sparse vector, which is a would be a sparse matrix rather than a sparse vector, which is a
deviation from numpy indexing rule. This decision is made largely deviation from numpy indexing rule. This decision is made largely
for keeping the consistency between numpy and theano. Subjected to preserve consistency between numpy and theano. This may be revised
to modification when sparse vector is supported. when sparse vectors are supported.
:param x: Sparse matrix. :param x: Sparse matrix.
:param index: Tuple of slice object. :param index: Tuple of slice object.
...@@ -1169,13 +1169,13 @@ class GetItemScalar(gof.op.Op): ...@@ -1169,13 +1169,13 @@ class GetItemScalar(gof.op.Op):
get_item_scalar = GetItemScalar() get_item_scalar = GetItemScalar()
"""Implement a subtensor of a sparse variable that take """Implement a subtensor of a sparse variable that take
two scalar as index and return a scalar. two scalars as index and return a scalar.
If you want to take a slice of a sparse matrix see If you want to take a slice of a sparse matrix see
`GetItem2d` that return a sparse matrix. `GetItem2d` that returns a sparse matrix.
:param x: Sparse matrix. :param x: Sparse matrix.
:param index: Tuple of scalar.. :param index: Tuple of scalars.
:return: The item corresponding in `x`. :return: The item corresponding in `x`.
...@@ -1502,18 +1502,18 @@ def sp_sum(x, axis=None, sparse_grad=False): ...@@ -1502,18 +1502,18 @@ def sp_sum(x, axis=None, sparse_grad=False):
axis. axis.
It operates a reduction along the axis specified. When It operates a reduction along the axis specified. When
`axis` is `None`, it is apply along all axis. `axis` is `None`, it is apply along all axes.
:param x: Sparse matrix. :param x: Sparse matrix.
:param axis: Axis along the sum is apply. Integers or `None`. :param axis: Axis along which the sum is applied. Integers or `None`.
:param sparse_grad: `True` to have a structured grad. Boolean. :param sparse_grad: `True` to have a structured grad. Boolean.
:return: The sum of `x` in a dense format. :return: The sum of `x` in a dense format.
:note: The grad implementation is controlled with the `sparse_grad` :note: The grad implementation is controlled with the `sparse_grad`
parameter. `True` will provide a structured grad and `False` parameter. `True` will provide a structured grad and `False`
will provide a regular grad. For both choice, the grad will provide a regular grad. For both choices, the grad
return a sparse matrix having the same format as `x`. returns a sparse matrix having the same format as `x`.
:note: This op does not return a sparse matrix, but a dense tensor :note: This op does not return a sparse matrix, but a dense tensor
matrix. matrix.
""" """
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论