Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
87fd0140
提交
87fd0140
authored
7月 15, 2015
作者:
Iban Harlouchet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
__props__ to basic.py
上级
2207c24f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
57 行删除
+15
-57
basic.py
theano/typed_list/basic.py
+15
-57
没有找到文件。
theano/typed_list/basic.py
浏览文件 @
87fd0140
...
...
@@ -56,12 +56,7 @@ TypedListType.Variable = TypedListVariable
class
GetItem
(
Op
):
# See doc in instance of this Op or function after this class definition.
view_map
=
{
0
:
[
0
]}
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
__props__
=
()
def
make_node
(
self
,
x
,
index
):
assert
isinstance
(
x
.
type
,
TypedListType
)
...
...
@@ -116,6 +111,8 @@ Get specified slice of a typed list.
class
Append
(
Op
):
# See doc in instance of this Op after the class definition.
__props__
=
(
"inplace"
)
def
__init__
(
self
,
inplace
=
False
):
self
.
inplace
=
inplace
if
self
.
inplace
:
...
...
@@ -128,12 +125,6 @@ class Append(Op):
# self.view_map = {0: [0, 1]}
self
.
view_map
=
{
0
:
[
0
]}
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
and
self
.
inplace
==
other
.
inplace
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
inplace
)
def
make_node
(
self
,
x
,
toAppend
):
assert
isinstance
(
x
.
type
,
TypedListType
)
assert
x
.
ttype
==
toAppend
.
type
,
(
x
.
ttype
,
toAppend
.
type
)
...
...
@@ -190,6 +181,8 @@ Append an element at the end of another list.
class
Extend
(
Op
):
# See doc in instance of this Op after the class definition.
__props__
=
(
"inplace"
)
def
__init__
(
self
,
inplace
=
False
):
self
.
inplace
=
inplace
if
self
.
inplace
:
...
...
@@ -202,12 +195,6 @@ class Extend(Op):
# self.view_map = {0: [0, 1]}
self
.
view_map
=
{
0
:
[
0
]}
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
and
self
.
inplace
==
other
.
inplace
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
inplace
)
def
make_node
(
self
,
x
,
toAppend
):
assert
isinstance
(
x
.
type
,
TypedListType
)
assert
x
.
type
==
toAppend
.
type
...
...
@@ -270,6 +257,8 @@ Append all elements of a list at the end of another list.
class
Insert
(
Op
):
# See doc in instance of this Op after the class definition.
__props__
=
(
"inplace"
)
def
__init__
(
self
,
inplace
=
False
):
self
.
inplace
=
inplace
if
self
.
inplace
:
...
...
@@ -282,12 +271,6 @@ class Insert(Op):
# self.view_map = {0: [0, 2]}
self
.
view_map
=
{
0
:
[
0
]}
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
and
self
.
inplace
==
other
.
inplace
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
inplace
)
def
make_node
(
self
,
x
,
index
,
toInsert
):
assert
isinstance
(
x
.
type
,
TypedListType
)
assert
x
.
ttype
==
toInsert
.
type
...
...
@@ -350,6 +333,8 @@ Insert an element at an index in a typed list.
class
Remove
(
Op
):
# See doc in instance of this Op after the class definition.
__props__
=
(
"inplace"
)
def
__init__
(
self
,
inplace
=
False
):
self
.
inplace
=
inplace
if
self
.
inplace
:
...
...
@@ -357,12 +342,6 @@ class Remove(Op):
else
:
self
.
view_map
=
{
0
:
[
0
]}
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
and
self
.
inplace
==
other
.
inplace
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
inplace
)
def
make_node
(
self
,
x
,
toRemove
):
assert
isinstance
(
x
.
type
,
TypedListType
)
assert
x
.
ttype
==
toRemove
.
type
...
...
@@ -405,6 +384,8 @@ remove = Remove()
class
Reverse
(
Op
):
# See doc in instance of this Op after the class definition.
__props__
=
(
"inplace"
)
def
__init__
(
self
,
inplace
=
False
):
self
.
inplace
=
inplace
if
self
.
inplace
:
...
...
@@ -412,12 +393,6 @@ class Reverse(Op):
else
:
self
.
view_map
=
{
0
:
[
0
]}
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
and
self
.
inplace
==
other
.
inplace
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
inplace
)
def
make_node
(
self
,
x
):
assert
isinstance
(
x
.
type
,
TypedListType
)
return
Apply
(
self
,
[
x
],
[
x
.
type
()])
...
...
@@ -468,11 +443,7 @@ Reverse the order of a typed list.
class
Index
(
Op
):
# See doc in instance of this Op after the class definition.
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
__props__
=
()
def
make_node
(
self
,
x
,
elem
):
assert
isinstance
(
x
.
type
,
TypedListType
)
...
...
@@ -500,11 +471,7 @@ index_ = Index()
class
Count
(
Op
):
# See doc in instance of this Op after the class definition.
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
__props__
=
()
def
make_node
(
self
,
x
,
elem
):
assert
isinstance
(
x
.
type
,
TypedListType
)
...
...
@@ -545,12 +512,7 @@ Count the number of times an element is in the typed list.
class
Length
(
Op
):
# See doc in instance of this Op after the class definition.
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
__props__
=
()
def
make_node
(
self
,
x
):
assert
isinstance
(
x
.
type
,
TypedListType
)
...
...
@@ -587,11 +549,7 @@ Returns the size of a list.
class
MakeList
(
Op
):
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
__props__
=
()
def
make_node
(
self
,
a
):
assert
isinstance
(
a
,
(
tuple
,
list
))
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论