Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
32b58ff4
提交
32b58ff4
authored
9月 08, 2010
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added library doc for stack() and concatenate()
上级
8895bc7e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
32 行增加
和
1 行删除
+32
-1
basic.txt
doc/library/tensor/basic.txt
+30
-0
basic.py
theano/tensor/basic.py
+2
-1
没有找到文件。
doc/library/tensor/basic.txt
浏览文件 @
32b58ff4
...
@@ -622,6 +622,36 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`
...
@@ -622,6 +622,36 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`
except for the main diagonal, whose values are equal to one. The output
except for the main diagonal, whose values are equal to one. The output
will have same dtype as `x`.
will have same dtype as `x`.
.. function:: stack(*tensors)
Return a Tensor representing for the arguments all stacked up into a single Tensor.
(of 1 rank greater).
:param tensors: one or more tensors of the same rank
:returns: A tensor such that rval[0] == tensors[0], rval[1] == tensors[1], etc.
>>> x0 = T.scalar()
>>> x1 = T.scalar()
>>> x2 = T.scalar()
>>> x = T.stack(x0, x1, x2)
>>> # x.ndim == 1, is a vector of length 3.
.. function:: concatenate(tensor_list, axis=0)
:type tensor_list: a list or tuple of Tensors that all have the same shape in the axes
*not* specified by the `axis` argument.
:param tensor_list: one or more Tensors to be concatenated together into one.
:type axis: literal or symbolic integer
:param axis: Tensors will be joined along this axis, so they may have different
``shape[axis]``
>>> x0 = T.fmatrix()
>>> x1 = T.ftensor3()
>>> x2 = T.fvector()
>>> x = T.concatenate([x0, x1[0], T.shape_padright(x2)], axis=1)
>>> # x.ndim == 2
Reductions
Reductions
==========
==========
...
...
theano/tensor/basic.py
浏览文件 @
32b58ff4
...
@@ -2960,7 +2960,8 @@ def shape_padright(t, n_ones=1):
...
@@ -2960,7 +2960,8 @@ def shape_padright(t, n_ones=1):
@constructor
@constructor
def
stack
(
*
tensors
):
def
stack
(
*
tensors
):
"""Insert the arguments as slices into a tensor of 1 rank greater.
"""Insert the arguments as slices into a tensor of 1 rank greater.
EXAMPLE
The size in dimension 0 of the result will be equal to the number of tensors passed.
"""
"""
if
len
(
tensors
)
==
0
:
if
len
(
tensors
)
==
0
:
raise
Exception
(
'theano.tensor.stack(*tensors) must have at least one parameter'
)
raise
Exception
(
'theano.tensor.stack(*tensors) must have at least one parameter'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论