Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
468fe6d2
提交
468fe6d2
authored
4月 13, 2015
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move DefaultOrderedDict to a more natural location.
上级
cd0b520b
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
40 行增加
和
37 行删除
+40
-37
__init__.py
theano/compat/__init__.py
+39
-0
python2x.py
theano/compat/python2x.py
+0
-35
cmodule.py
theano/gof/cmodule.py
+1
-1
conv3d2d.py
theano/tensor/nnet/conv3d2d.py
+0
-1
没有找到文件。
theano/compat/__init__.py
浏览文件 @
468fe6d2
...
...
@@ -56,3 +56,42 @@ else:
def
decode_iter
(
x
):
return
x
__all__
+=
[
'cmp'
,
'operator_div'
,
'partial'
,
'defaultdict'
,
'deque'
,
'combinations'
,
'product'
,
'maxsize'
,
'DictMixin'
,
'OrderedDict'
,
'decode'
,
'decode_iter'
]
class
DefaultOrderedDict
(
OrderedDict
):
def
__init__
(
self
,
default_factory
=
None
,
*
a
,
**
kw
):
if
(
default_factory
is
not
None
and
not
callable
(
default_factory
)):
raise
TypeError
(
'first argument must be callable'
)
OrderedDict
.
__init__
(
self
,
*
a
,
**
kw
)
self
.
default_factory
=
default_factory
def
__getitem__
(
self
,
key
):
try
:
return
OrderedDict
.
__getitem__
(
self
,
key
)
except
KeyError
:
return
self
.
__missing__
(
key
)
def
__missing__
(
self
,
key
):
if
self
.
default_factory
is
None
:
raise
KeyError
(
key
)
self
[
key
]
=
value
=
self
.
default_factory
()
return
value
def
__reduce__
(
self
):
if
self
.
default_factory
is
None
:
args
=
tuple
()
else
:
args
=
self
.
default_factory
,
return
type
(
self
),
args
,
None
,
None
,
self
.
items
()
def
copy
(
self
):
return
self
.
__copy__
()
def
__copy__
(
self
):
return
type
(
self
)(
self
.
default_factory
,
self
)
__all__
+=
[
'DefaultOrderedDict'
]
theano/compat/python2x.py
浏览文件 @
468fe6d2
...
...
@@ -516,38 +516,3 @@ else:
__all__
+=
[
'DictMixin'
,
'OrderedDict'
,
'Counter'
]
class
DefaultOrderedDict
(
OrderedDict
):
def
__init__
(
self
,
default_factory
=
None
,
*
a
,
**
kw
):
if
(
default_factory
is
not
None
and
not
callable
(
default_factory
)):
raise
TypeError
(
'first argument must be callable'
)
OrderedDict
.
__init__
(
self
,
*
a
,
**
kw
)
self
.
default_factory
=
default_factory
def
__getitem__
(
self
,
key
):
try
:
return
OrderedDict
.
__getitem__
(
self
,
key
)
except
KeyError
:
return
self
.
__missing__
(
key
)
def
__missing__
(
self
,
key
):
if
self
.
default_factory
is
None
:
raise
KeyError
(
key
)
self
[
key
]
=
value
=
self
.
default_factory
()
return
value
def
__reduce__
(
self
):
if
self
.
default_factory
is
None
:
args
=
tuple
()
else
:
args
=
self
.
default_factory
,
return
type
(
self
),
args
,
None
,
None
,
self
.
items
()
def
copy
(
self
):
return
self
.
__copy__
()
def
__copy__
(
self
):
return
type
(
self
)(
self
.
default_factory
,
self
)
__all__
+=
[
'DefaultOrderedDict'
]
theano/gof/cmodule.py
浏览文件 @
468fe6d2
...
...
@@ -24,7 +24,7 @@ except ImportError:
import
numpy.distutils
# TODO: TensorType should handle this
import
theano
from
theano.compat
import
any
,
PY3
,
next
,
decode
,
decode_iter
from
theano.compat
import
PY3
,
next
,
decode
,
decode_iter
from
theano.compat.six
import
b
,
BytesIO
,
StringIO
from
theano.gof.utils
import
flatten
from
theano.configparser
import
config
...
...
theano/tensor/nnet/conv3d2d.py
浏览文件 @
468fe6d2
import
theano
from
theano.compat
import
any
from
theano.gradient
import
DisconnectedType
from
theano.gof
import
Op
,
Apply
,
TopoOptimizer
from
theano
import
tensor
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论