Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
b2abbe89
提交
b2abbe89
authored
4月 05, 2010
作者:
Razvan Pascanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added info about shape_padleft, shape_padright, addbroadcast, unbroadcast
上级
6a1ac4b0
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
54 行增加
和
0 行删除
+54
-0
basic.txt
doc/library/tensor/basic.txt
+54
-0
没有找到文件。
doc/library/tensor/basic.txt
浏览文件 @
b2abbe89
...
@@ -451,8 +451,23 @@ TensorVariable
...
@@ -451,8 +451,23 @@ TensorVariable
pattern will include the integers 0, 1, ... ndim-1, and any number of
pattern will include the integers 0, 1, ... ndim-1, and any number of
'x' characters in dimensions where this tensor should be broadcasted.
'x' characters in dimensions where this tensor should be broadcasted.
A few examples of patterns and their effect:
('x') -> make a 0d (scalar) into a 1d vector
(0, 1) -> identity for 2d vectors
(1, 0) -> inverts the first and second dimensions
('x', 0) -> make a row out of a 1d vector (N to 1xN)
(0, 'x') -> make a column out of a 1d vector (N to Nx1)
(2, 0, 1) -> AxBxC to CxAxB
(0, 'x', 1) -> AxB to Ax1xB
(1, 'x', 0) -> AxB to Bx1xA
See :func:`dimshuffle`.
See :func:`dimshuffle`.
.. method:: flatten(ndim=1)
.. method:: flatten(ndim=1)
Returns a view of this tensor with `ndim` dimensions, whose shape for the first
Returns a view of this tensor with `ndim` dimensions, whose shape for the first
...
@@ -507,6 +522,45 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`
...
@@ -507,6 +522,45 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`
function will raise an Exception.
function will raise an Exception.
.. function:: shape_padleft(x, n_ones=1)
Reshape `x` by left padding the shape with `n_ones` 1s. Note that all
this new dimension will be broadcastable. To make them non-broadcastable
see the :func:`unbroadcast`.
:param x: variable to be reshaped
:type x: any TensorVariable (or compatible)
:type n_ones: int
:type n_ones: number of dimension to be added to `x`
.. function:: shape_padright(x,n_ones = 1)
Reshape `x` by right padding the shape with `n_ones` 1s. Note that all
this new dimension will be broadcastable. To make them non-broadcastable
see the :func:`unbroadcast`.
:param x: variable to be reshaped
:type x: any TensorVariable (or compatible)
:type n_ones: int
:type n_ones: number of dimension to be added to `x`
.. function:: unbroadcast(x, *axes):
Make `x` impossible to broadcast in the specified axes `axes`. For
example, `unbroadcast(x,0)` will make the first dimension of `x`
unbroadcastable.
.. function:: addbroadcast(x, *axes):
Make `x` broadcastable in the specified axes `axes`. For
example, `unbroadcast(x,0)` will make the first dimension of `x`
broadcastable.
.. function:: flatten(x, outdim=1)
.. function:: flatten(x, outdim=1)
Similar to :func:`reshape`, but the shape is inferred from the shape of `x`.
Similar to :func:`reshape`, but the shape is inferred from the shape of `x`.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论