Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
01eb03d4
提交
01eb03d4
authored
11月 16, 2012
作者:
Ian Goodfellow
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
subtensor doc
上级
971e1302
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
13 行增加
和
6 行删除
+13
-6
basic.py
theano/tensor/basic.py
+13
-6
没有找到文件。
theano/tensor/basic.py
浏览文件 @
01eb03d4
...
@@ -3802,7 +3802,7 @@ class AdvancedIndexingError(TypeError):
...
@@ -3802,7 +3802,7 @@ class AdvancedIndexingError(TypeError):
class
Subtensor
(
Op
):
class
Subtensor
(
Op
):
"""Return a subtensor view
"""Return a subtensor view
The inputs array is the tensor x, followed by scalar integer
variabl
es.
The inputs array is the tensor x, followed by scalar integer
typ
es.
TODO: WRITEME: how are the scalar integer variables formatted?
TODO: WRITEME: how are the scalar integer variables formatted?
This class uses a relatively complex internal representation of the inputs
This class uses a relatively complex internal representation of the inputs
...
@@ -3811,7 +3811,7 @@ class Subtensor(Op):
...
@@ -3811,7 +3811,7 @@ class Subtensor(Op):
idx_list: instance variable TODO: WRITEME: is this a list or a tuple?
idx_list: instance variable TODO: WRITEME: is this a list or a tuple?
(old docstring gives two conflicting
(old docstring gives two conflicting
descriptions)
descriptions)
elements are either integers, theano scalars, or slices.
elements are either integers, theano scalar
type
s, or slices.
one element per "explicitly named dimension"
one element per "explicitly named dimension"
TODO: WRITEME: what is an "explicitly named dimension" ?
TODO: WRITEME: what is an "explicitly named dimension" ?
...
@@ -3820,7 +3820,11 @@ class Subtensor(Op):
...
@@ -3820,7 +3820,11 @@ class Subtensor(Op):
if slice:
if slice:
start/stop/step members of each slice are integer indices
start/stop/step members of each slice are integer indices
into the inputs array or None
into the inputs array or None
integer indices be actual integers or theano scalars
integer indices be actual integers or theano scalar types
Note that the idx_list defines the Op, so two Subtensor instances are
considered to be different Ops if they have different idx_list fields.
This means that the entries in it are theano Types, not theano Variables.
@todo: add support for advanced tensor indexing (in Subtensor_dx too).
@todo: add support for advanced tensor indexing (in Subtensor_dx too).
...
@@ -3868,9 +3872,12 @@ class Subtensor(Op):
...
@@ -3868,9 +3872,12 @@ class Subtensor(Op):
@staticmethod
@staticmethod
def
convert
(
entry
,
slice_ok
=
True
):
def
convert
(
entry
,
slice_ok
=
True
):
"""
"""
TODO: WRITEME
The "idx_list" field is unique to each Subtensor instance.
TODO: In particular, wtf does it mean to have a Type instead of a Variable
It is not unique to each Apply node, so it should not refer to
in here?
specific Variables. This method changes references to Variables
into references to Types.
TODO: WRITEME: This method also accepts "entry" already being a Type;
when would that happen?
"""
"""
invalid_scal_types
=
[
scal
.
float64
,
scal
.
float32
]
invalid_scal_types
=
[
scal
.
float64
,
scal
.
float32
]
scal_types
=
[
scal
.
int64
,
scal
.
int32
,
scal
.
int16
,
scal
.
int8
]
scal_types
=
[
scal
.
int64
,
scal
.
int32
,
scal
.
int16
,
scal
.
int8
]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论