提交 f0d6f48e authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Small typos and formatting fixes

上级 5a7081d7
...@@ -442,9 +442,9 @@ correctly (for example, for MKL this might be ``-lmkl -lguide -lpthread`` or ...@@ -442,9 +442,9 @@ correctly (for example, for MKL this might be ``-lmkl -lguide -lpthread`` or
If you have problems linking with MKL, `Intel Line Advisor If you have problems linking with MKL, `Intel Line Advisor
<http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor>`_ <http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor>`_
and `MKL User Guide and the `MKL User Guide
<http://software.intel.com/sites/products/documentation/doclib/mkl_sa/11/mkl_userguide_lnx/index.htm>`_ <http://software.intel.com/sites/products/documentation/doclib/mkl_sa/11/mkl_userguide_lnx/index.htm>`_
can help you find the correct flag to use. can help you find the correct flags to use.
.. _gpu_linux: .. _gpu_linux:
......
...@@ -646,30 +646,30 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`. ...@@ -646,30 +646,30 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`.
>>> x = T.concatenate([x0, x1[0], T.shape_padright(x2)], axis=1) >>> x = T.concatenate([x0, x1[0], T.shape_padright(x2)], axis=1)
>>> # x.ndim == 2 >>> # x.ndim == 2
.. function:: stacklist(tensor_list) .. function:: stacklists(tensor_list)
:type tensor_list: an iterable that contain tensors or iterable :type tensor_list: an iterable that contains either tensors or other
with at the end tensors. iterables of the same type as `tensor_list` (in other words, this
:param tensor_list: tensors to be is a tree whose leaves are tensors).
stackend together. :param tensor_list: tensors to be stacked together.
Recursivly stack lists of tensors to maintain similar structure. Recursively stack lists of tensors to maintain similar structure.
This function can create a tensor from a shaped list of scalars This function can create a tensor from a shaped list of scalars:
>>> from theano.tensor import stacklists, scalars, matrices >>> from theano.tensor import stacklists, scalars, matrices
>>> from theano import function >>> from theano import function
>>> a,b,c,d = scalars('abcd') >>> a, b, c, d = scalars('abcd')
>>> X = stacklists([[a, b], [c, d]]) >>> X = stacklists([[a, b], [c, d]])
>>> f = function([a, b, c, d], X) >>> f = function([a, b, c, d], X)
>>> f(1, 2, 3, 4) >>> f(1, 2, 3, 4)
>>> # array([[ 1., 2.], [ 3., 4.]], dtype=float32) >>> # array([[ 1., 2.], [ 3., 4.]], dtype=float32)
We can also stack arbitrarily shaped tensors. Here we stack matrices into We can also stack arbitrarily shaped tensors. Here we stack matrices into
a 2 by 2 grid. a 2 by 2 grid:
>>> from numpy import ones >>> from numpy import ones
>>> a,b,c,d, = matrices('abcd') >>> a, b, c, d = matrices('abcd')
>>> X = stacklists([[a, b], [c, d]]) >>> X = stacklists([[a, b], [c, d]])
>>> f = function([a, b, c, d], X) >>> f = function([a, b, c, d], X)
>>> x = ones((4, 4), 'float32') >>> x = ones((4, 4), 'float32')
......
...@@ -8236,24 +8236,25 @@ def diag(v, k=0): ...@@ -8236,24 +8236,25 @@ def diag(v, k=0):
def stacklists(arg): def stacklists(arg):
""" Recursivly stack lists of tensors to maintain similar structure """
Recursively stack lists of tensors to maintain similar structure.
This function can create a tensor from a shaped list of scalars This function can create a tensor from a shaped list of scalars:
>>> from theano.tensor import stacklists, scalars, matrices >>> from theano.tensor import stacklists, scalars, matrices
>>> from theano import function >>> from theano import function
>>> a,b,c,d = scalars('abcd') >>> a, b, c, d = scalars('abcd')
>>> X = stacklists([[a, b], [c, d]]) >>> X = stacklists([[a, b], [c, d]])
>>> f = function([a, b, c, d], X) >>> f = function([a, b, c, d], X)
>>> f(1, 2, 3, 4) >>> f(1, 2, 3, 4)
array([[ 1., 2.], array([[ 1., 2.],
[ 3., 4.]], dtype=float32) [ 3., 4.]], dtype=float32)
We can also stack arbitrarily shaped tensors. Here we stack matrices into We can also stack arbitrarily shaped tensors. Here we stack matrices into
a 2 by 2 grid. a 2 by 2 grid:
>>> from numpy import ones >>> from numpy import ones
>>> a,b,c,d, = matrices('abcd') >>> a, b, c, d = matrices('abcd')
>>> X = stacklists([[a, b], [c, d]]) >>> X = stacklists([[a, b], [c, d]])
>>> f = function([a, b, c, d], X) >>> f = function([a, b, c, d], X)
>>> x = ones((4, 4), 'float32') >>> x = ones((4, 4), 'float32')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论