Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
46a7d4b8
提交
46a7d4b8
authored
10月 14, 2008
作者:
Olivier Breuleux
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed initialize in module
上级
a702c107
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
5 行增加
和
11 行删除
+5
-11
module.py
theano/sandbox/module.py
+5
-11
没有找到文件。
theano/sandbox/module.py
浏览文件 @
46a7d4b8
...
@@ -258,10 +258,6 @@ class CompositeInstance(object):
...
@@ -258,10 +258,6 @@ class CompositeInstance(object):
##self.__items__[item] = value
##self.__items__[item] = value
raise
TypeError
(
'Cannot set item
%
s'
%
item
)
raise
TypeError
(
'Cannot set item
%
s'
%
item
)
def
initialize
(
self
,
init
):
for
i
,
initv
in
enumerate
(
init
):
self
[
i
]
=
initv
class
Composite
(
Component
):
class
Composite
(
Component
):
def
resolve
(
self
,
name
):
def
resolve
(
self
,
name
):
...
@@ -325,9 +321,14 @@ class Composite(Component):
...
@@ -325,9 +321,14 @@ class Composite(Component):
class
ComponentListInstance
(
CompositeInstance
):
class
ComponentListInstance
(
CompositeInstance
):
def
__str__
(
self
):
def
__str__
(
self
):
return
'[
%
s]'
%
', '
.
join
(
map
(
str
,
self
.
__items__
))
return
'[
%
s]'
%
', '
.
join
(
map
(
str
,
self
.
__items__
))
def
initialize
(
self
,
init
):
for
i
,
initv
in
enumerate
(
init
):
self
[
i
]
=
initv
class
ComponentList
(
Composite
):
class
ComponentList
(
Composite
):
def
__init__
(
self
,
*
_components
):
def
__init__
(
self
,
*
_components
):
...
@@ -408,10 +409,6 @@ class ModuleInstance(CompositeInstance):
...
@@ -408,10 +409,6 @@ class ModuleInstance(CompositeInstance):
return
return
super
(
ModuleInstance
,
self
)
.
__setitem__
(
item
,
value
)
super
(
ModuleInstance
,
self
)
.
__setitem__
(
item
,
value
)
def
initialize
(
self
,
init
=
{},
**
kwinit
):
for
name
,
value
in
chain
(
init
.
iteritems
(),
kwinit
.
iteritems
()):
self
[
name
]
=
value
def
__str__
(
self
):
def
__str__
(
self
):
strings
=
[]
strings
=
[]
for
k
,
v
in
sorted
(
self
.
__items__
.
iteritems
()):
for
k
,
v
in
sorted
(
self
.
__items__
.
iteritems
()):
...
@@ -533,9 +530,6 @@ class FancyModuleInstance(ModuleInstance):
...
@@ -533,9 +530,6 @@ class FancyModuleInstance(ModuleInstance):
raise
AttributeError
(
'
%
s has no
%
s attribute.'
%
(
self
.
__class__
,
attr
))
raise
AttributeError
(
'
%
s has no
%
s attribute.'
%
(
self
.
__class__
,
attr
))
def
__setattr__
(
self
,
attr
,
value
):
def
__setattr__
(
self
,
attr
,
value
):
if
attr
in
dir
(
self
)
or
attr
in
dir
(
self
.
__class__
):
# man this sucks
self
.
__dict__
[
attr
]
=
value
try
:
try
:
self
[
attr
]
=
value
self
[
attr
]
=
value
except
:
except
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论