Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c0b324fa
提交
c0b324fa
authored
10月 21, 2020
作者:
Brandon T. Willard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Apply isort to theano.scan_module sub-package modules
上级
969cf83c
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
43 行增加
和
53 行删除
+43
-53
__init__.py
theano/scan_module/__init__.py
+1
-1
scan.py
theano/scan_module/scan.py
+6
-9
scan_op.py
theano/scan_module/scan_op.py
+11
-15
scan_opt.py
theano/scan_module/scan_opt.py
+9
-13
scan_perform.pyx
theano/scan_module/scan_perform.pyx
+5
-3
scan_perform_ext.py
theano/scan_module/scan_perform_ext.py
+2
-2
scan_utils.py
theano/scan_module/scan_utils.py
+8
-10
scan_views.py
theano/scan_module/scan_views.py
+1
-0
没有找到文件。
theano/scan_module/__init__.py
浏览文件 @
c0b324fa
...
...
@@ -44,5 +44,5 @@ __contact__ = "Razvan Pascanu <r.pascanu@gmail>"
from
theano.scan_module
import
scan_opt
from
theano.scan_module.scan
import
scan
from
theano.scan_module.scan_checkpoints
import
scan_checkpoints
from
theano.scan_module.scan_views
import
map
,
reduce
,
foldl
,
foldr
from
theano.scan_module.scan_utils
import
clone
,
until
from
theano.scan_module.scan_views
import
foldl
,
foldr
,
map
,
reduce
theano/scan_module/scan.py
浏览文件 @
c0b324fa
...
...
@@ -43,23 +43,20 @@ __contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import
logging
import
numpy
as
np
import
theano.tensor
as
tt
from
collections
import
OrderedDict
import
numpy
as
np
from
six
import
integer_types
from
theano
import
compile
,
gof
,
config
import
theano.tensor
as
tt
from
theano
import
compile
,
config
,
gof
from
theano.compile
import
SharedVariable
,
function
,
ops
from
theano.tensor
import
opt
from
theano.updates
import
OrderedUpdates
from
theano.gof.utils
import
TestValueError
from
theano.scan_module
import
scan_op
,
scan_utils
from
theano.scan_module.scan_utils
import
safe_new
,
traverse
from
theano.tensor
import
opt
from
theano.updates
import
OrderedUpdates
_logger
=
logging
.
getLogger
(
"theano.scan_module.scan"
)
...
...
theano/scan_module/scan_op.py
浏览文件 @
c0b324fa
...
...
@@ -52,29 +52,25 @@ import copy
import
itertools
import
logging
import
time
import
numpy
as
np
import
theano
from
collections
import
OrderedDict
import
numpy
as
np
from
six
import
integer_types
,
raise_from
,
string_types
from
theano.compile
import
function
,
In
,
Out
import
theano
from
theano
import
compile
,
config
,
gof
,
gradient
,
tensor
from
theano.compile
import
In
,
Out
,
function
from
theano.compile.mode
import
AddFeatureOptimizer
from
theano
import
compile
,
config
,
gradient
,
gof
,
tensor
from
theano.gof
import
PureOp
,
Apply
from
theano.gof.graph
import
io_connection_pattern
,
equal_computations
from
theano
.compile.profiling
import
ScanProfileStats
from
theano.gof
import
Apply
,
PureOp
from
theano.gof.graph
import
equal_computations
,
io_connection_pattern
from
theano.gof.toolbox
import
NoOutputFromInplace
from
theano.tensor
import
as_tensor_variable
,
TensorType
from
theano.gradient
import
DisconnectedType
,
NullType
,
grad_undefined
from
theano.scan_module
import
scan_utils
from
theano.scan_module.scan_utils
import
forced_replace
,
safe_new
from
theano.tensor
import
TensorType
,
as_tensor_variable
from
theano.tensor.opt
import
Shape_i
from
theano.gradient
import
grad_undefined
,
DisconnectedType
,
NullType
from
theano.compile.profiling
import
ScanProfileStats
from
theano.scan_module
import
scan_utils
from
theano.scan_module.scan_utils
import
safe_new
,
forced_replace
__docformat__
=
"restructedtext en"
__authors__
=
"Razvan Pascanu "
"Frederic Bastien "
"James Bergstra "
"Pascal Lamblin "
...
...
theano/scan_module/scan_opt.py
浏览文件 @
c0b324fa
...
...
@@ -50,29 +50,25 @@ scan_eqopt2 -> They are all global optimizer. (in2out convert local to global).
in2out(remove_constants_and_unused_inputs_scan3)
"""
import
logging
import
copy
import
numpy
as
np
import
theano
from
sys
import
maxsize
import
logging
from
collections
import
OrderedDict
from
sys
import
maxsize
import
numpy
as
np
from
six
import
integer_types
from
theano
import
gof
,
tensor
,
scalar
from
theano.tensor
import
opt
,
get_scalar_constant_value
,
Alloc
,
AllocEmpty
import
theano
from
theano
import
gof
,
scalar
,
tensor
from
theano.compile
import
optdb
from
theano.compile.function_module
import
deep_copy_op
from
theano.gof
import
toolbox
,
DestroyHandler
,
InconsistencyError
from
theano.gof.opt
import
Optimizer
,
pre_constant_merge
,
pre_greedy_local_optimizer
from
theano.gof
import
DestroyHandler
,
InconsistencyError
,
toolbox
from
theano.gof.graph
import
equal_computations
from
theano.gof.opt
import
Optimizer
,
pre_constant_merge
,
pre_greedy_local_optimizer
from
theano.scan_module
import
scan_op
,
scan_utils
from
theano.scan_module.scan_utils
import
scan_args
from
theano.tensor
import
Alloc
,
AllocEmpty
,
get_scalar_constant_value
,
opt
__docformat__
=
"restructedtext en"
__authors__
=
(
...
...
theano/scan_module/scan_perform.pyx
浏览文件 @
c0b324fa
...
...
@@ -53,12 +53,14 @@ __contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import cython
import numpy
cimport numpy
from theano import gof
import time
import copy
import time
from theano import gof
def get_version():
...
...
theano/scan_module/scan_perform_ext.py
浏览文件 @
c0b324fa
...
...
@@ -17,8 +17,8 @@ import numpy as np
import
theano
from
theano
import
config
from
theano.compat
import
reload
from
theano.gof.compilelock
import
get_lock
,
release_lock
from
theano.gof
import
cmodule
from
theano.gof.compilelock
import
get_lock
,
release_lock
_logger
=
logging
.
getLogger
(
"theano.scan_module.scan_perform"
)
...
...
@@ -148,5 +148,5 @@ except ImportError:
# To fix it completly, we would need to modify Cython to use the new API.
with
warnings
.
catch_warnings
():
warnings
.
filterwarnings
(
"ignore"
,
message
=
"numpy.ndarray size changed"
)
from
scan_perform.scan_perform
import
perform
,
get_version
# noqa: F401
from
scan_perform.scan_perform
import
get_version
,
perform
# noqa: F401
assert
version
==
get_version
()
theano/scan_module/scan_utils.py
浏览文件 @
c0b324fa
...
...
@@ -21,19 +21,16 @@ __contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import
copy
import
logging
import
warnings
import
numpy
as
np
import
theano
from
collections
import
OrderedDict
import
numpy
as
np
from
six
import
string_types
from
theano
import
gof
,
compat
,
tensor
,
scalar
import
theano
from
theano
import
compat
,
gof
,
scalar
,
tensor
from
theano.compile.pfunc
import
rebuild_collect_shared
from
theano.tensor.basic
import
get_scalar_constant_value
from
theano.gof.utils
import
TestValueError
from
theano.tensor.basic
import
get_scalar_constant_value
# Logging function for sending warning or info
...
...
@@ -149,8 +146,8 @@ def traverse(out, x, x_copy, d, visited=None):
if
out
in
visited
:
return
d
visited
.
add
(
out
)
from
theano.gpuarray.basic_ops
import
GpuFromHost
,
host_from_gpu
from
theano.gpuarray
import
pygpu_activated
from
theano.gpuarray.basic_ops
import
GpuFromHost
,
host_from_gpu
from
theano.gpuarray.type
import
GpuArrayType
if
out
==
x
:
...
...
@@ -327,8 +324,8 @@ def map_variables(replacer, graphs, additional_inputs=None):
return
False
# importing Scan into module scope would be circular
from
theano.scan_module.scan_op
import
Scan
from
theano.compile
import
OpFromGraph
from
theano.scan_module.scan_op
import
Scan
if
isinstance
(
node
.
op
,
(
Scan
,
OpFromGraph
)):
# recurse on the inner graph
...
...
@@ -389,9 +386,10 @@ def _map_variables_inner(
extra_inner_inputs
=
[]
extra_outer_inputs
=
[]
from
theano.scan_module
import
scan_utils
from
itertools
import
chain
from
theano
import
gof
from
theano.scan_module
import
scan_utils
def
inner_replacer
(
graph
):
new_graph
=
replacer
(
graph
)
...
...
theano/scan_module/scan_views.py
浏览文件 @
c0b324fa
...
...
@@ -16,6 +16,7 @@ import logging
from
theano.scan_module
import
scan
# Logging function for sending warning or info
_logger
=
logging
.
getLogger
(
"theano.scan_module.scan_views"
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论