Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a2168c05
提交
a2168c05
authored
4月 28, 2013
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1351 from nouiz/doc_mkl
Add a note in the doc with URL to help link with MKL.
上级
725a4be0
8e6888c5
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
46 行增加
和
8 行删除
+46
-8
install.txt
doc/install.txt
+8
-0
basic.txt
doc/library/tensor/basic.txt
+30
-1
basic.py
theano/tensor/basic.py
+8
-7
没有找到文件。
doc/install.txt
浏览文件 @
a2168c05
...
@@ -438,6 +438,14 @@ correctly (for example, for MKL this might be ``-lmkl -lguide -lpthread`` or
...
@@ -438,6 +438,14 @@ correctly (for example, for MKL this might be ``-lmkl -lguide -lpthread`` or
This might be just a problem with the way Theano passes compilation
This might be just a problem with the way Theano passes compilation
arguments to g++, but the problem is not fixed yet.
arguments to g++, but the problem is not fixed yet.
.. note::
If you have problems linking with MKL, `Intel Line Advisor
<http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor>`_
and `MKL User Guide
<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.
.. _gpu_linux:
.. _gpu_linux:
Using the GPU
Using the GPU
...
...
doc/library/tensor/basic.txt
浏览文件 @
a2168c05
...
@@ -646,6 +646,35 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`.
...
@@ -646,6 +646,35 @@ 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)
:type tensor_list: an iterable that contain tensors or iterable
with at the end tensors.
:param tensor_list: tensors to be
stackend together.
Recursivly stack lists of tensors to maintain similar structure.
This function can create a tensor from a shaped list of scalars
>>> from theano.tensor import stacklists, scalars, matrices
>>> from theano import function
>>> a,b,c,d = scalars('abcd')
>>> X = stacklists([[a, b], [c, d]])
>>> f = function([a, b, c, d], X)
>>> f(1, 2, 3, 4)
>>> # array([[ 1., 2.], [ 3., 4.]], dtype=float32)
We can also stack arbitrarily shaped tensors. Here we stack matrices into
a 2 by 2 grid.
>>> from numpy import ones
>>> a,b,c,d, = matrices('abcd')
>>> X = stacklists([[a, b], [c, d]])
>>> f = function([a, b, c, d], X)
>>> x = ones((4, 4), 'float32')
>>> f(x, x, x, x).shape
>>> # (2, 2, 4, 4)
Reductions
Reductions
==========
==========
...
@@ -800,7 +829,7 @@ Reductions
...
@@ -800,7 +829,7 @@ Reductions
inner summation. This will not necessarily be the dtype of the
inner summation. This will not necessarily be the dtype of the
output (in particular if it is a discrete (int/uint) dtype, the
output (in particular if it is a discrete (int/uint) dtype, the
output will be in a float type). If None, then we use the same
output will be in a float type). If None, then we use the same
rules as :
ref
:`sum()`.
rules as :
func
:`sum()`.
:Returns: mean value of *x* along *axis*
:Returns: mean value of *x* along *axis*
axis can be:
axis can be:
...
...
theano/tensor/basic.py
浏览文件 @
a2168c05
...
@@ -8234,15 +8234,16 @@ def diag(v, k=0):
...
@@ -8234,15 +8234,16 @@ def diag(v, k=0):
else
:
else
:
raise
ValueError
(
"Input must be 1- or 2-d."
)
raise
ValueError
(
"Input must be 1- or 2-d."
)
def
stacklists
(
arg
):
def
stacklists
(
arg
):
""" Recursivly stack lists of tensors to maintain similar structure
""" Recursivly 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, scalar, matrix
>>> from theano.tensor import stacklists, scalars, matrices
>>> from theano import function
>>> from theano import function
>>> a,b,c,d = map(scalar, 'abcd')
>>> a,b,c,d = scalars('abcd')
>>> X = stacklists([[a, b],
>>> X = stacklists([[a, b], [c, d]])
... [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.],
...
@@ -8250,10 +8251,10 @@ def stacklists(arg):
...
@@ -8250,10 +8251,10 @@ def stacklists(arg):
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, = [tensor.matrix(a) for a in 'abcd']
>>> a,b,c,d, = matrices('abcd')
>>> X = stacklists([[a, b],
>>> X = stacklists([[a, b], [c, d]])
... [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')
>>> f(x, x, x, x).shape
>>> f(x, x, x, x).shape
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论