Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5bb459cf
提交
5bb459cf
authored
12月 17, 2020
作者:
Michael Osthege
提交者:
Brandon T. Willard
12月 21, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Migrate all of theano.gof.link to theano.link sub-package
上级
8bf588af
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
48 行增加
和
27 行删除
+48
-27
debugging_with_stepmode.txt
doc/sandbox/debugging_with_stepmode.txt
+1
-1
test_cc.py
tests/gof/test_cc.py
+1
-1
test_link.py
tests/gof/test_link.py
+1
-2
test_opt_uncanonicalize.py
tests/tensor/test_opt_uncanonicalize.py
+2
-1
debugmode.py
theano/compile/debugmode.py
+5
-4
types.py
theano/compile/function/types.py
+2
-2
__init__.py
theano/gof/__init__.py
+8
-2
cc.py
theano/gof/cc.py
+2
-2
vm.py
theano/gof/vm.py
+1
-3
__init__.py
theano/link/__init__.py
+17
-1
basic.py
theano/link/basic.py
+0
-0
debugging.py
theano/link/debugging.py
+0
-0
jax_linker.py
theano/link/jax/jax_linker.py
+2
-2
op.py
theano/scan/op.py
+3
-3
scan_perform.pyx
theano/scan/scan_perform.pyx
+3
-3
没有找到文件。
doc/sandbox/debugging_with_stepmode.txt
浏览文件 @
5bb459cf
...
@@ -11,7 +11,7 @@ purpose of it is to hack it to investigate what your own particular program is d
...
@@ -11,7 +11,7 @@ purpose of it is to hack it to investigate what your own particular program is d
.. code-block:: python
.. code-block:: python
from theano.
gof.
link import WrapLinkerMany
from theano.link import WrapLinkerMany
from theano import config
from theano import config
from theano.compile.mode import (Mode, register_mode, predefined_modes, predefined_linkers,
from theano.compile.mode import (Mode, register_mode, predefined_modes, predefined_linkers,
predefined_optimizers)
predefined_optimizers)
...
...
tests/gof/test_cc.py
浏览文件 @
5bb459cf
...
@@ -5,9 +5,9 @@ import theano
...
@@ -5,9 +5,9 @@ import theano
from
theano.gof
import
fg
from
theano.gof
import
fg
from
theano.gof.cc
import
CLinker
,
DualLinker
,
OpWiseCLinker
from
theano.gof.cc
import
CLinker
,
DualLinker
,
OpWiseCLinker
from
theano.gof.graph
import
Apply
,
Constant
,
Variable
from
theano.gof.graph
import
Apply
,
Constant
,
Variable
from
theano.gof.link
import
PerformLinker
from
theano.gof.op
import
Op
from
theano.gof.op
import
Op
from
theano.gof.type
import
Type
from
theano.gof.type
import
Type
from
theano.link
import
PerformLinker
def
as_variable
(
x
):
def
as_variable
(
x
):
...
...
tests/gof/test_link.py
浏览文件 @
5bb459cf
...
@@ -5,10 +5,9 @@ import numpy as np
...
@@ -5,10 +5,9 @@ import numpy as np
import
theano
import
theano
from
theano.gof
import
fg
,
graph
from
theano.gof
import
fg
,
graph
from
theano.gof.graph
import
Apply
,
Constant
,
Variable
from
theano.gof.graph
import
Apply
,
Constant
,
Variable
from
theano.gof.link
import
PerformLinker
,
WrapLinker
from
theano.gof.op
import
Op
from
theano.gof.op
import
Op
from
theano.gof.type
import
Type
from
theano.gof.type
import
Type
from
theano.link
import
Container
from
theano.link
import
Container
,
PerformLinker
,
WrapLinker
from
theano.utils
import
cmp
from
theano.utils
import
cmp
...
...
tests/tensor/test_opt_uncanonicalize.py
浏览文件 @
5bb459cf
...
@@ -6,6 +6,7 @@ from tests import unittest_tools as utt
...
@@ -6,6 +6,7 @@ from tests import unittest_tools as utt
from
theano
import
config
,
function
,
scalar
from
theano
import
config
,
function
,
scalar
from
theano.gof
import
FunctionGraph
from
theano.gof
import
FunctionGraph
from
theano.gof.opt
import
out2in
from
theano.gof.opt
import
out2in
from
theano.link.basic
import
PerformLinker
# from theano.tensor import matrix,max_and_argmax,MaaxAndArgmax,neg
# from theano.tensor import matrix,max_and_argmax,MaaxAndArgmax,neg
from
theano.tensor.elemwise
import
CAReduce
,
DimShuffle
,
Elemwise
from
theano.tensor.elemwise
import
CAReduce
,
DimShuffle
,
Elemwise
...
@@ -158,7 +159,7 @@ def test_local_dimshuffle_alloc():
...
@@ -158,7 +159,7 @@ def test_local_dimshuffle_alloc():
g
=
FunctionGraph
([
x
],
[
out
])
g
=
FunctionGraph
([
x
],
[
out
])
reshape_dimshuffle
(
g
)
reshape_dimshuffle
(
g
)
l
=
theano
.
gof
.
PerformLinker
()
l
=
PerformLinker
()
l
.
accept
(
g
)
l
.
accept
(
g
)
f
=
l
.
make_function
()
f
=
l
.
make_function
()
...
...
theano/compile/debugmode.py
浏览文件 @
5bb459cf
...
@@ -28,7 +28,8 @@ from theano.compile.function.types import (
...
@@ -28,7 +28,8 @@ from theano.compile.function.types import (
from
theano.compile.mode
import
Mode
,
register_mode
from
theano.compile.mode
import
Mode
,
register_mode
from
theano.compile.ops
import
OutputGuard
,
_output_guard
from
theano.compile.ops
import
OutputGuard
,
_output_guard
from
theano.gof
import
graph
,
ops_with_inner_function
,
utils
from
theano.gof
import
graph
,
ops_with_inner_function
,
utils
from
theano.gof.link
import
raise_with_op
from
theano.link.basic
import
LocalLinker
from
theano.link.debugging
import
raise_with_op
from
theano.utils
import
get_unbound_function
from
theano.utils
import
get_unbound_function
...
@@ -1739,14 +1740,14 @@ class _DummyLinker:
...
@@ -1739,14 +1740,14 @@ class _DummyLinker:
return
self
return
self
class
_Linker
(
link
.
LocalLinker
):
class
_Linker
(
LocalLinker
):
"""
"""
Special debugging linker.
Special debugging linker.
"""
"""
def
__init__
(
self
,
maker
,
schedule
=
None
):
def
__init__
(
self
,
maker
,
schedule
=
None
):
super
(
gof
.
LocalLinker
,
self
)
.
__init__
()
super
()
.
__init__
()
self
.
fgraph
=
None
self
.
fgraph
=
None
self
.
maker
=
maker
self
.
maker
=
maker
super
()
.
__init__
(
scheduler
=
schedule
)
super
()
.
__init__
(
scheduler
=
schedule
)
...
@@ -1792,7 +1793,7 @@ class _Linker(link.LocalLinker):
...
@@ -1792,7 +1793,7 @@ class _Linker(link.LocalLinker):
# the function's outputs will always be freshly allocated.
# the function's outputs will always be freshly allocated.
no_recycling
=
[]
no_recycling
=
[]
input_storage
,
output_storage
,
storage_map
=
theano
.
gof
.
link
.
map_storage
(
input_storage
,
output_storage
,
storage_map
=
theano
.
link
.
map_storage
(
fgraph
,
order
,
input_storage_
,
output_storage_
,
storage_map
fgraph
,
order
,
input_storage_
,
output_storage_
,
storage_map
)
)
...
...
theano/compile/function/types.py
浏览文件 @
5bb459cf
...
@@ -15,7 +15,7 @@ import numpy as np
...
@@ -15,7 +15,7 @@ import numpy as np
import
theano
import
theano
import
theano.compile.profiling
import
theano.compile.profiling
from
theano
import
config
,
gof
from
theano
import
config
,
gof
,
link
from
theano.compile.io
import
In
,
SymbolicInput
,
SymbolicOutput
from
theano.compile.io
import
In
,
SymbolicInput
,
SymbolicOutput
from
theano.compile.ops
import
deep_copy_op
,
view_op
from
theano.compile.ops
import
deep_copy_op
,
view_op
from
theano.gof
import
graph
from
theano.gof
import
graph
...
@@ -978,7 +978,7 @@ class Function:
...
@@ -978,7 +978,7 @@ class Function:
thunk
=
None
thunk
=
None
if
hasattr
(
self
.
fn
,
"thunks"
):
if
hasattr
(
self
.
fn
,
"thunks"
):
thunk
=
self
.
fn
.
thunks
[
self
.
fn
.
position_of_error
]
thunk
=
self
.
fn
.
thunks
[
self
.
fn
.
position_of_error
]
gof
.
link
.
raise_with_op
(
link
.
raise_with_op
(
self
.
maker
.
fgraph
,
self
.
maker
.
fgraph
,
node
=
self
.
fn
.
nodes
[
self
.
fn
.
position_of_error
],
node
=
self
.
fn
.
nodes
[
self
.
fn
.
position_of_error
],
thunk
=
thunk
,
thunk
=
thunk
,
...
...
theano/gof/__init__.py
浏览文件 @
5bb459cf
...
@@ -5,7 +5,6 @@ from theano.gof.cc import CLinker, DualLinker, HideC, OpWiseCLinker
...
@@ -5,7 +5,6 @@ from theano.gof.cc import CLinker, DualLinker, HideC, OpWiseCLinker
from
theano.gof.destroyhandler
import
DestroyHandler
from
theano.gof.destroyhandler
import
DestroyHandler
from
theano.gof.fg
import
FunctionGraph
,
InconsistencyError
,
MissingInputError
from
theano.gof.fg
import
FunctionGraph
,
InconsistencyError
,
MissingInputError
from
theano.gof.graph
import
Apply
,
Constant
,
Variable
,
view_roots
from
theano.gof.graph
import
Apply
,
Constant
,
Variable
,
view_roots
from
theano.gof.link
import
PerformLinker
,
WrapLinker
,
WrapLinkerMany
from
theano.gof.op
import
(
from
theano.gof.op
import
(
COp
,
COp
,
Op
,
Op
,
...
@@ -47,7 +46,14 @@ from theano.gof.toolbox import (
...
@@ -47,7 +46,14 @@ from theano.gof.toolbox import (
)
)
from
theano.gof.type
import
CEnumType
,
EnumList
,
EnumType
,
Generic
,
Type
,
generic
from
theano.gof.type
import
CEnumType
,
EnumList
,
EnumType
,
Generic
,
Type
,
generic
from
theano.gof.utils
import
MethodNotDefined
,
hashtype
,
object2
from
theano.gof.utils
import
MethodNotDefined
,
hashtype
,
object2
from
theano.link
import
Container
,
Linker
,
LocalLinker
from
theano.link
import
(
Container
,
Linker
,
LocalLinker
,
PerformLinker
,
WrapLinker
,
WrapLinkerMany
,
)
if
theano
.
config
.
cmodule__preload_cache
:
if
theano
.
config
.
cmodule__preload_cache
:
...
...
theano/gof/cc.py
浏览文件 @
5bb459cf
...
@@ -11,8 +11,8 @@ from io import StringIO
...
@@ -11,8 +11,8 @@ from io import StringIO
import
numpy
as
np
import
numpy
as
np
from
theano
import
config
from
theano
import
config
,
link
from
theano.gof
import
cmodule
,
graph
,
link
,
utils
from
theano.gof
import
cmodule
,
graph
,
utils
from
theano.gof.callcache
import
CallCache
from
theano.gof.callcache
import
CallCache
from
theano.gof.compilelock
import
get_lock
,
release_lock
from
theano.gof.compilelock
import
get_lock
,
release_lock
...
...
theano/gof/vm.py
浏览文件 @
5bb459cf
...
@@ -13,9 +13,7 @@ import warnings
...
@@ -13,9 +13,7 @@ import warnings
from
collections
import
defaultdict
from
collections
import
defaultdict
import
theano.gof.cmodule
import
theano.gof.cmodule
from
theano
import
config
from
theano
import
config
,
link
from
.
import
link
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
theano/link/__init__.py
浏览文件 @
5bb459cf
from
theano.link.basic
import
Container
,
Linker
,
LocalLinker
import
sys
from
theano.link.basic
import
(
Container
,
Linker
,
LocalLinker
,
PerformLinker
,
WrapLinker
,
WrapLinkerMany
,
gc_helper
,
map_storage
,
streamline
,
)
from
theano.link.debugging
import
raise_with_op
,
set_excepthook
set_excepthook
(
handler
=
sys
.
stdout
)
theano/link/basic.py
浏览文件 @
5bb459cf
差异被折叠。
点击展开。
theano/
gof/link
.py
→
theano/
link/debugging
.py
浏览文件 @
5bb459cf
差异被折叠。
点击展开。
theano/link/jax/jax_linker.py
浏览文件 @
5bb459cf
...
@@ -3,14 +3,14 @@ from warnings import warn
...
@@ -3,14 +3,14 @@ from warnings import warn
from
theano.gof
import
utils
from
theano.gof
import
utils
from
theano.gof.graph
import
Constant
from
theano.gof.graph
import
Constant
from
theano.gof.link
import
(
from
theano.link.basic
import
(
Container
,
PerformLinker
,
PerformLinker
,
add_clear_storage
,
add_clear_storage
,
gc_helper
,
gc_helper
,
map_storage
,
map_storage
,
streamline
,
streamline
,
)
)
from
theano.link
import
Container
class
JAXLinker
(
PerformLinker
):
class
JAXLinker
(
PerformLinker
):
...
...
theano/scan/op.py
浏览文件 @
5bb459cf
...
@@ -53,7 +53,7 @@ from collections import OrderedDict
...
@@ -53,7 +53,7 @@ from collections import OrderedDict
import
numpy
as
np
import
numpy
as
np
import
theano
import
theano
from
theano
import
compile
,
config
,
gof
,
gradient
,
tensor
from
theano
import
compile
,
config
,
gof
,
gradient
,
link
,
tensor
from
theano.compile.builders
import
infer_shape
from
theano.compile.builders
import
infer_shape
from
theano.compile.function
import
function
from
theano.compile.function
import
function
from
theano.compile.io
import
In
,
Out
from
theano.compile.io
import
In
,
Out
...
@@ -1465,7 +1465,7 @@ class Scan(PureOp):
...
@@ -1465,7 +1465,7 @@ class Scan(PureOp):
# done by raise_with_op is not implemented in C.
# done by raise_with_op is not implemented in C.
if
hasattr
(
fn
,
"thunks"
):
if
hasattr
(
fn
,
"thunks"
):
# For the CVM
# For the CVM
gof
.
link
.
raise_with_op
(
link
.
raise_with_op
(
self
.
fn
.
maker
.
fgraph
,
self
.
fn
.
maker
.
fgraph
,
fn
.
nodes
[
fn
.
position_of_error
],
fn
.
nodes
[
fn
.
position_of_error
],
fn
.
thunks
[
fn
.
position_of_error
],
fn
.
thunks
[
fn
.
position_of_error
],
...
@@ -1475,7 +1475,7 @@ class Scan(PureOp):
...
@@ -1475,7 +1475,7 @@ class Scan(PureOp):
# We don't have access from python to all the
# We don't have access from python to all the
# temps values So for now, we just don't print
# temps values So for now, we just don't print
# the extra shapes/strides info
# the extra shapes/strides info
gof
.
link
.
raise_with_op
(
link
.
raise_with_op
(
self
.
fn
.
maker
.
fgraph
,
fn
.
nodes
[
fn
.
position_of_error
]
self
.
fn
.
maker
.
fgraph
,
fn
.
nodes
[
fn
.
position_of_error
]
)
)
else
:
else
:
...
...
theano/scan/scan_perform.pyx
浏览文件 @
5bb459cf
...
@@ -61,7 +61,7 @@ cimport numpy
...
@@ -61,7 +61,7 @@ cimport numpy
import copy
import copy
import time
import time
from theano import gof
from theano import gof
, link
def get_version():
def get_version():
...
@@ -405,7 +405,7 @@ def perform(
...
@@ -405,7 +405,7 @@ def perform(
# done by raise_with_op is not implemented in C.
# done by raise_with_op is not implemented in C.
if hasattr(fn, 'thunks'):
if hasattr(fn, 'thunks'):
# For the CVM
# For the CVM
gof.
link.raise_with_op(fn.maker.fgraph,
link.raise_with_op(fn.maker.fgraph,
fn.nodes[fn.position_of_error],
fn.nodes[fn.position_of_error],
fn.thunks[fn.position_of_error])
fn.thunks[fn.position_of_error])
else:
else:
...
@@ -413,7 +413,7 @@ def perform(
...
@@ -413,7 +413,7 @@ def perform(
# We don't have access from python to all the
# We don't have access from python to all the
# temps values So for now, we just don't print
# temps values So for now, we just don't print
# the extra shapes/strides info
# the extra shapes/strides info
gof.
link.raise_with_op(fn.maker.fgraph, fn.nodes[fn.position_of_error])
link.raise_with_op(fn.maker.fgraph, fn.nodes[fn.position_of_error])
else:
else:
# old-style linkers raise their own exceptions
# old-style linkers raise their own exceptions
raise
raise
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论