提交 84c355e3 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

More typo fixes

上级 f1038c21
...@@ -693,7 +693,7 @@ CSC = CSM('csc') ...@@ -693,7 +693,7 @@ CSC = CSM('csc')
representation. representation.
:param data: One dimensional tensor representing :param data: One dimensional tensor representing
the data of the sparse to construct. the data of the sparse matrix to construct.
:param indices: One dimensional tensor of integers :param indices: One dimensional tensor of integers
representing the indices of the sparse representing the indices of the sparse
matrix to construct. matrix to construct.
...@@ -716,7 +716,7 @@ CSR = CSM('csr') ...@@ -716,7 +716,7 @@ CSR = CSM('csr')
representation. representation.
:param data: One dimensional tensor representing :param data: One dimensional tensor representing
the data of the sparse to construct. the data of the sparse matrix to construct.
:param indices: One dimensional tensor of integers :param indices: One dimensional tensor of integers
representing the indices of the sparse representing the indices of the sparse
matrix to construct. matrix to construct.
...@@ -1096,18 +1096,18 @@ class GetItem2d(gof.op.Op): ...@@ -1096,18 +1096,18 @@ class GetItem2d(gof.op.Op):
return self.__class__.__name__ return self.__class__.__name__
get_item_2d = GetItem2d() get_item_2d = GetItem2d()
"""Implement a subtensor of sparse variable and that return a """Implement a subtensor of sparse variable, returning a
sparse matrix. sparse matrix.
If you want to take only one element of a sparse matrix see If you want to take only one element of a sparse matrix see
`GetItemScalar` that return a tensor scalar. `GetItemScalar` that returns a tensor scalar.
.. note:: .. note::
Subtensor selection always returns a matrix, so indexing Subtensor selection always returns a matrix, so indexing
with [a:b, c:d] is forced. If one index is a scalar. For with [a:b, c:d] is forced. If one index is a scalar, for
instance, x[a:b, c] and x[a, b:c], generate an error. Use instance, x[a:b, c] or x[a, b:c], an error will be raised. Use
instead x[a:b, c:c+1] and x[a:a+1, b:c]. instead x[a:b, c:c+1] or x[a:a+1, b:c].
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
...@@ -1118,7 +1118,7 @@ when sparse vectors are supported. ...@@ -1118,7 +1118,7 @@ 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.
:return: The slice corresponding in `x`. :return: The corresponding slice in `x`.
:note: The grad is not implemented for this op. :note: The grad is not implemented for this op.
""" """
...@@ -1168,8 +1168,8 @@ class GetItemScalar(gof.op.Op): ...@@ -1168,8 +1168,8 @@ class GetItemScalar(gof.op.Op):
return self.__class__.__name__ return self.__class__.__name__
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 takes
two scalars as index and return a scalar. two scalars as index and returns 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 returns a sparse matrix. `GetItem2d` that returns a sparse matrix.
...@@ -1177,7 +1177,7 @@ If you want to take a slice of a sparse matrix see ...@@ -1177,7 +1177,7 @@ If you want to take a slice of a sparse matrix see
:param x: Sparse matrix. :param x: Sparse matrix.
:param index: Tuple of scalars. :param index: Tuple of scalars.
:return: The item corresponding in `x`. :return: The corresponding item in `x`.
:note: The grad is not implemented for this op. :note: The grad is not implemented for this op.
""" """
...@@ -1498,14 +1498,14 @@ class SpSum(gof.op.Op): ...@@ -1498,14 +1498,14 @@ class SpSum(gof.op.Op):
def sp_sum(x, axis=None, sparse_grad=False): def sp_sum(x, axis=None, sparse_grad=False):
"""Calculate the sum of a sparse matrix along a specify """Calculate the sum of a sparse matrix along a specific
axis. axis.
It operates a reduction along the axis specified. When It operates a reduction along the specified axis. When
`axis` is `None`, it is apply along all axes. `axis` is `None`, it is applied along all axes.
:param x: Sparse matrix. :param x: Sparse matrix.
:param axis: Axis along which the sum is applied. Integers or `None`. :param axis: Axis along which the sum is applied. Integer 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.
...@@ -1645,7 +1645,7 @@ class EnsureSortedIndices(gof.op.Op): ...@@ -1645,7 +1645,7 @@ class EnsureSortedIndices(gof.op.Op):
else: else:
return self.__class__.__name__ + "{no_inplace}" return self.__class__.__name__ + "{no_inplace}"
ensure_sorted_indices = EnsureSortedIndices(inplace=False) ensure_sorted_indices = EnsureSortedIndices(inplace=False)
"""Resort indices of a sparse matrix. """Re-sort indices of a sparse matrix.
CSR column indices are not necessarily sorted. Likewise CSR column indices are not necessarily sorted. Likewise
for CSC row indices. Use `ensure_sorted_indices` when sorted for CSC row indices. Use `ensure_sorted_indices` when sorted
...@@ -1662,12 +1662,12 @@ libraries). ...@@ -1662,12 +1662,12 @@ libraries).
def clean(x): def clean(x):
"""Remove explicit zeros from a sparse matrix, and """Remove explicit zeros from a sparse matrix, and
resort indices. re-sort indices.
CSR column indices are not necessarily sorted. Likewise CSR column indices are not necessarily sorted. Likewise
for CSC row indices. Use `clean` when sorted for CSC row indices. Use `clean` when sorted
indices are required (e.g. when passing data to other indices are required (e.g. when passing data to other
libraries) and to ensure there is no zeros in the data. libraries) and to ensure there are no zeros in the data.
:param x: A sparse matrix. :param x: A sparse matrix.
...@@ -1860,9 +1860,9 @@ class StructuredAddSV(gof.op.Op): ...@@ -1860,9 +1860,9 @@ class StructuredAddSV(gof.op.Op):
return self.__class__.__name__ return self.__class__.__name__
structured_add_s_v = StructuredAddSV() structured_add_s_v = StructuredAddSV()
"""Structured addition of a sparse matrix and a dense vector. """Structured addition of a sparse matrix and a dense vector.
The elements of the vector are are only added to the corresponding The elements of the vector are only added to the corresponding
non-zero elements. Therefore, this operation outputs another sparse non-zero elements of the sparse matrix. Therefore, this operation
matrix. outputs another sparse matrix.
:param x: Sparse matrix. :param x: Sparse matrix.
:param y: Tensor type vector. :param y: Tensor type vector.
...@@ -3696,7 +3696,7 @@ class Usmm(gof.op.Op): ...@@ -3696,7 +3696,7 @@ class Usmm(gof.op.Op):
out[0] = rval out[0] = rval
usmm = Usmm() usmm = Usmm()
"""Performs the expression is `alpha` * `x` `y` + `z`. """Performs the expression `alpha` * `x` `y` + `z`.
:param x: Matrix variable. :param x: Matrix variable.
:param y: Matrix variable. :param y: Matrix variable.
......
...@@ -101,7 +101,7 @@ getitem = GetItem() ...@@ -101,7 +101,7 @@ getitem = GetItem()
""" """
Get specified slice of a typed list. Get specified slice of a typed list.
:param x: type type list. :param x: typed list.
:param index: the index of the value to return from `x`. :param index: the index of the value to return from `x`.
""" """
...@@ -227,7 +227,7 @@ class Extend(Op): ...@@ -227,7 +227,7 @@ class Extend(Op):
extend = Extend() extend = Extend()
""" """
Append all element of a list at the end of another list. Append all elements of a list at the end of another list.
:param x: The typed list to extend. :param x: The typed list to extend.
:param toAppend: The typed list that will be added at the end of `x`. :param toAppend: The typed list that will be added at the end of `x`.
...@@ -296,7 +296,7 @@ insert = Insert() ...@@ -296,7 +296,7 @@ insert = Insert()
""" """
Insert an element at an index in a typed list. Insert an element at an index in a typed list.
:param x: the typed list to modified. :param x: the typed list to modify.
:param index: the index where to put the new element in `x`. :param index: the index where to put the new element in `x`.
:param toInsert: The new element to insert. :param toInsert: The new element to insert.
""" """
...@@ -475,11 +475,11 @@ class Count(Op): ...@@ -475,11 +475,11 @@ class Count(Op):
count = Count() count = Count()
""" """
Count the number of time an element is in the typed list. Count the number of times an element is in the typed list.
:param x: The typed list to look into. :param x: The typed list to look into.
:param elem: The element we want to count in list. :param elem: The element we want to count in list.
The element are compared with equals. The elements are compared with equals.
:note: Python implementation of count doesn't work when we want to :note: Python implementation of count doesn't work when we want to
count an ndarray from a list. This implementation works in that count an ndarray from a list. This implementation works in that
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论