Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
fb6b8625
提交
fb6b8625
authored
12月 21, 2020
作者:
Brandon T. Willard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename theano.link.c.cc to theano.link.c.basic
上级
900d752c
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
20 行增加
和
20 行删除
+20
-20
test_elemwise.py
tests/gpuarray/test_elemwise.py
+1
-1
test_cc.py
tests/link/test_cc.py
+1
-1
test_vm.py
tests/link/test_vm.py
+1
-1
record.py
tests/record.py
+1
-1
test_basic.py
tests/scalar/test_basic.py
+1
-1
test_basic_sympy.py
tests/scalar/test_basic_sympy.py
+1
-1
test_type.py
tests/tensor/random/test_type.py
+1
-1
test_basic.py
tests/tensor/test_basic.py
+1
-1
test_elemwise.py
tests/tensor/test_elemwise.py
+1
-1
__init__.py
theano/__init__.py
+1
-1
types.py
theano/compile/function/types.py
+1
-1
mode.py
theano/compile/mode.py
+1
-1
monitormode.py
theano/compile/monitormode.py
+1
-1
op.py
theano/gof/op.py
+2
-2
basic_ops.py
theano/gpuarray/basic_ops.py
+1
-1
opt.py
theano/gpuarray/opt.py
+1
-1
basic.py
theano/link/c/basic.py
+1
-1
op.py
theano/scan/op.py
+1
-1
elemwise.py
theano/tensor/elemwise.py
+1
-1
没有找到文件。
tests/gpuarray/test_elemwise.py
浏览文件 @
fb6b8625
...
@@ -26,7 +26,7 @@ from theano.gpuarray.elemwise import (
...
@@ -26,7 +26,7 @@ from theano.gpuarray.elemwise import (
)
)
from
theano.gpuarray.type
import
GpuArrayType
,
get_context
,
gpuarray_shared_constructor
from
theano.gpuarray.type
import
GpuArrayType
,
get_context
,
gpuarray_shared_constructor
from
theano.link.basic
import
PerformLinker
from
theano.link.basic
import
PerformLinker
from
theano.link.c.
c
c
import
CLinker
from
theano.link.c.
basi
c
import
CLinker
# This is actually a test for GpuElemwise
# This is actually a test for GpuElemwise
...
...
tests/link/test_cc.py
浏览文件 @
fb6b8625
...
@@ -7,7 +7,7 @@ from theano.gof.graph import Apply, Constant, Variable
...
@@ -7,7 +7,7 @@ from theano.gof.graph import Apply, Constant, Variable
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.basic
import
PerformLinker
from
theano.link.basic
import
PerformLinker
from
theano.link.c.
c
c
import
CLinker
,
DualLinker
,
OpWiseCLinker
from
theano.link.c.
basi
c
import
CLinker
,
DualLinker
,
OpWiseCLinker
def
as_variable
(
x
):
def
as_variable
(
x
):
...
...
tests/link/test_vm.py
浏览文件 @
fb6b8625
...
@@ -128,7 +128,7 @@ def test_speed():
...
@@ -128,7 +128,7 @@ def test_speed():
print
(
f
"{name} takes {1000 * (t_b - t_a) / (steps_b - steps_a):f} s/Kop"
)
print
(
f
"{name} takes {1000 * (t_b - t_a) / (steps_b - steps_a):f} s/Kop"
)
from
theano.link.c.
c
c
import
OpWiseCLinker
from
theano.link.c.
basi
c
import
OpWiseCLinker
time_linker
(
"c|py"
,
OpWiseCLinker
)
time_linker
(
"c|py"
,
OpWiseCLinker
)
time_linker
(
"vmLinker"
,
VMLinker
)
time_linker
(
"vmLinker"
,
VMLinker
)
...
...
tests/record.py
浏览文件 @
fb6b8625
...
@@ -249,7 +249,7 @@ class RecordMode(Mode):
...
@@ -249,7 +249,7 @@ class RecordMode(Mode):
line
=
f
"Outputs: {outputs_digest}
\n
"
line
=
f
"Outputs: {outputs_digest}
\n
"
handle_line
(
fgraph
,
line
,
i
,
node
,
fn
)
handle_line
(
fgraph
,
line
,
i
,
node
,
fn
)
# linker = theano.link.c.
c
c.OpWiseCLinker()
# linker = theano.link.c.
basi
c.OpWiseCLinker()
linker
=
VMLinker
(
use_cloop
=
bool
(
config
.
cxx
))
linker
=
VMLinker
(
use_cloop
=
bool
(
config
.
cxx
))
wrap_linker
=
WrapLinkerMany
([
linker
],
[
callback
])
wrap_linker
=
WrapLinkerMany
([
linker
],
[
callback
])
...
...
tests/scalar/test_basic.py
浏览文件 @
fb6b8625
...
@@ -14,7 +14,7 @@ import pytest
...
@@ -14,7 +14,7 @@ import pytest
import
tests.unittest_tools
as
utt
import
tests.unittest_tools
as
utt
import
theano
import
theano
from
theano.gof
import
FunctionGraph
from
theano.gof
import
FunctionGraph
from
theano.link.c.
c
c
import
DualLinker
from
theano.link.c.
basi
c
import
DualLinker
from
theano.scalar.basic
import
(
from
theano.scalar.basic
import
(
ComplexError
,
ComplexError
,
Composite
,
Composite
,
...
...
tests/scalar/test_basic_sympy.py
浏览文件 @
fb6b8625
...
@@ -20,7 +20,7 @@ def test_SymPyCCode():
...
@@ -20,7 +20,7 @@ def test_SymPyCCode():
op
=
SymPyCCode
([
xs
,
ys
],
xs
+
ys
)
op
=
SymPyCCode
([
xs
,
ys
],
xs
+
ys
)
e
=
op
(
xt
,
yt
)
e
=
op
(
xt
,
yt
)
g
=
theano
.
gof
.
FunctionGraph
([
xt
,
yt
],
[
e
])
g
=
theano
.
gof
.
FunctionGraph
([
xt
,
yt
],
[
e
])
fn
=
theano
.
link
.
c
.
c
c
.
CLinker
()
.
accept
(
g
)
.
make_function
()
fn
=
theano
.
link
.
c
.
basi
c
.
CLinker
()
.
accept
(
g
)
.
make_function
()
assert
fn
(
1.0
,
2.0
)
==
3.0
assert
fn
(
1.0
,
2.0
)
==
3.0
...
...
tests/tensor/random/test_type.py
浏览文件 @
fb6b8625
...
@@ -16,7 +16,7 @@ def test_view_op_c_code():
...
@@ -16,7 +16,7 @@ def test_view_op_c_code():
# TODO: It might be good to make sure that the registered C code works
# TODO: It might be good to make sure that the registered C code works
# (even though it's basically copy-paste from other registered `Op`s).
# (even though it's basically copy-paste from other registered `Op`s).
# from theano.compile.ops import view_op
# from theano.compile.ops import view_op
# from theano.link.c.
c
c import CLinker
# from theano.link.c.
basi
c import CLinker
# rng_var = random_state_type()
# rng_var = random_state_type()
# rng_view = view_op(rng_var)
# rng_view = view_op(rng_var)
# function(
# function(
...
...
tests/tensor/test_basic.py
浏览文件 @
fb6b8625
...
@@ -72,7 +72,7 @@ from theano import compile, config, function, gof, shared
...
@@ -72,7 +72,7 @@ from theano import compile, config, function, gof, shared
from
theano.compile
import
DeepCopyOp
from
theano.compile
import
DeepCopyOp
from
theano.compile.mode
import
get_default_mode
from
theano.compile.mode
import
get_default_mode
from
theano.gof.graph
import
Variable
from
theano.gof.graph
import
Variable
from
theano.link.c.
c
c
import
DualLinker
from
theano.link.c.
basi
c
import
DualLinker
from
theano.scalar
import
autocast_float
,
autocast_float_as
from
theano.scalar
import
autocast_float
,
autocast_float_as
from
theano.tensor
import
(
from
theano.tensor
import
(
Alloc
,
Alloc
,
...
...
tests/tensor/test_elemwise.py
浏览文件 @
fb6b8625
...
@@ -12,7 +12,7 @@ from tests import unittest_tools
...
@@ -12,7 +12,7 @@ from tests import unittest_tools
from
theano
import
config
,
gof
,
scalar
from
theano
import
config
,
gof
,
scalar
from
theano.compile.mode
import
Mode
,
get_default_mode
from
theano.compile.mode
import
Mode
,
get_default_mode
from
theano.link.basic
import
PerformLinker
from
theano.link.basic
import
PerformLinker
from
theano.link.c.
c
c
import
CLinker
,
OpWiseCLinker
from
theano.link.c.
basi
c
import
CLinker
,
OpWiseCLinker
from
theano.tensor
import
TensorType
,
as_tensor_variable
from
theano.tensor
import
TensorType
,
as_tensor_variable
from
theano.tensor.elemwise
import
(
from
theano.tensor.elemwise
import
(
CAReduce
,
CAReduce
,
...
...
theano/__init__.py
浏览文件 @
fb6b8625
...
@@ -115,7 +115,7 @@ from theano.gof import (
...
@@ -115,7 +115,7 @@ from theano.gof import (
)
)
from
theano.gradient
import
Lop
,
Rop
,
grad
,
subgraph_grad
from
theano.gradient
import
Lop
,
Rop
,
grad
,
subgraph_grad
from
theano.link.basic
import
Container
,
Linker
,
LocalLinker
,
PerformLinker
from
theano.link.basic
import
Container
,
Linker
,
LocalLinker
,
PerformLinker
from
theano.link.c.
c
c
import
CLinker
,
DualLinker
,
OpWiseCLinker
from
theano.link.c.
basi
c
import
CLinker
,
DualLinker
,
OpWiseCLinker
from
theano.misc.safe_asarray
import
_asarray
from
theano.misc.safe_asarray
import
_asarray
from
theano.printing
import
pp
,
pprint
from
theano.printing
import
pp
,
pprint
from
theano.updates
import
OrderedUpdates
from
theano.updates
import
OrderedUpdates
...
...
theano/compile/function/types.py
浏览文件 @
fb6b8625
...
@@ -1536,7 +1536,7 @@ class FunctionMaker:
...
@@ -1536,7 +1536,7 @@ class FunctionMaker:
# too much execution time during testing as we compile
# too much execution time during testing as we compile
# much more functions then the number of compile c
# much more functions then the number of compile c
# module.
# module.
theano
.
link
.
c
.
c
c
.
get_module_cache
()
.
refresh
()
theano
.
link
.
c
.
basi
c
.
get_module_cache
()
.
refresh
()
# Handle the case where inputs and/or outputs is a single
# Handle the case where inputs and/or outputs is a single
# Variable (not in a list)
# Variable (not in a list)
unpack_single
=
False
unpack_single
=
False
...
...
theano/compile/mode.py
浏览文件 @
fb6b8625
...
@@ -10,7 +10,7 @@ import theano
...
@@ -10,7 +10,7 @@ import theano
from
theano
import
config
,
gof
from
theano
import
config
,
gof
from
theano.compile.function.types
import
Supervisor
from
theano.compile.function.types
import
Supervisor
from
theano.link.basic
import
PerformLinker
from
theano.link.basic
import
PerformLinker
from
theano.link.c.
c
c
import
CLinker
,
OpWiseCLinker
from
theano.link.c.
basi
c
import
CLinker
,
OpWiseCLinker
from
theano.link.jax
import
JAXLinker
from
theano.link.jax
import
JAXLinker
from
theano.link.vm
import
VMLinker
from
theano.link.vm
import
VMLinker
...
...
theano/compile/monitormode.py
浏览文件 @
fb6b8625
...
@@ -5,7 +5,7 @@ import numpy as np
...
@@ -5,7 +5,7 @@ import numpy as np
from
theano.compile.mode
import
Mode
from
theano.compile.mode
import
Mode
from
theano.configdefaults
import
config
from
theano.configdefaults
import
config
from
theano.link.basic
import
WrapLinkerMany
from
theano.link.basic
import
WrapLinkerMany
from
theano.link.c.
c
c
import
OpWiseCLinker
from
theano.link.c.
basi
c
import
OpWiseCLinker
class
MonitorMode
(
Mode
):
class
MonitorMode
(
Mode
):
...
...
theano/gof/op.py
浏览文件 @
fb6b8625
...
@@ -843,7 +843,7 @@ class Op(object2, PureOp, CLinkerOp):
...
@@ -843,7 +843,7 @@ class Op(object2, PureOp, CLinkerOp):
# FIXME: Putting the following import on the module level causes an import cycle.
# FIXME: Putting the following import on the module level causes an import cycle.
# The conclusion should be that the antire "make_c_thunk" method should be defined
# The conclusion should be that the antire "make_c_thunk" method should be defined
# in theano.link.c and dispatched onto the Op!
# in theano.link.c and dispatched onto the Op!
import
theano.link.c.
c
c
import
theano.link.c.
basi
c
node_input_storage
=
[
storage_map
[
r
]
for
r
in
node
.
inputs
]
node_input_storage
=
[
storage_map
[
r
]
for
r
in
node
.
inputs
]
node_output_storage
=
[
storage_map
[
r
]
for
r
in
node
.
outputs
]
node_output_storage
=
[
storage_map
[
r
]
for
r
in
node
.
outputs
]
...
@@ -854,7 +854,7 @@ class Op(object2, PureOp, CLinkerOp):
...
@@ -854,7 +854,7 @@ class Op(object2, PureOp, CLinkerOp):
for
(
new_o
,
old_o
)
in
zip
(
e
.
outputs
,
node
.
outputs
)
for
(
new_o
,
old_o
)
in
zip
(
e
.
outputs
,
node
.
outputs
)
if
old_o
in
no_recycling
if
old_o
in
no_recycling
]
]
cl
=
theano
.
link
.
c
.
c
c
.
CLinker
()
.
accept
(
e
,
no_recycling
=
e_no_recycling
)
cl
=
theano
.
link
.
c
.
basi
c
.
CLinker
()
.
accept
(
e
,
no_recycling
=
e_no_recycling
)
# float16 gets special treatment since running
# float16 gets special treatment since running
# unprepared C code will get bad results.
# unprepared C code will get bad results.
if
not
getattr
(
self
,
"_f16_ok"
,
False
):
if
not
getattr
(
self
,
"_f16_ok"
,
False
):
...
...
theano/gpuarray/basic_ops.py
浏览文件 @
fb6b8625
...
@@ -11,7 +11,7 @@ from theano.gof import COp, ParamsType
...
@@ -11,7 +11,7 @@ from theano.gof import COp, ParamsType
from
theano.gof.opt
import
copy_stack_trace
from
theano.gof.opt
import
copy_stack_trace
from
theano.gof.utils
import
MethodNotDefined
from
theano.gof.utils
import
MethodNotDefined
from
theano.gradient
import
grad_undefined
from
theano.gradient
import
grad_undefined
from
theano.link.c.
c
c
import
HideC
from
theano.link.c.
basi
c
import
HideC
from
theano.scalar
import
bool
as
bool_t
from
theano.scalar
import
bool
as
bool_t
from
theano.scalar
import
int32
as
int32_t
from
theano.scalar
import
int32
as
int32_t
from
theano.tensor.basic
import
Alloc
,
AllocEmpty
,
Join
,
Split
,
alloc_validate_shape
from
theano.tensor.basic
import
Alloc
,
AllocEmpty
,
Join
,
Split
,
alloc_validate_shape
...
...
theano/gpuarray/opt.py
浏览文件 @
fb6b8625
...
@@ -150,7 +150,7 @@ from theano.gpuarray.type import (
...
@@ -150,7 +150,7 @@ from theano.gpuarray.type import (
move_to_gpu
,
move_to_gpu
,
)
)
from
theano.ifelse
import
IfElse
from
theano.ifelse
import
IfElse
from
theano.link.c.
c
c
import
CLinker
from
theano.link.c.
basi
c
import
CLinker
from
theano.misc.ordered_set
import
OrderedSet
from
theano.misc.ordered_set
import
OrderedSet
from
theano.scalar.basic
import
Cast
,
Pow
,
Scalar
,
log
,
neg
,
true_div
from
theano.scalar.basic
import
Cast
,
Pow
,
Scalar
,
log
,
neg
,
true_div
from
theano.scalar.basic_scipy
import
Erfcinv
,
Erfinv
from
theano.scalar.basic_scipy
import
Erfcinv
,
Erfinv
...
...
theano/link/c/
c
c.py
→
theano/link/c/
basi
c.py
浏览文件 @
fb6b8625
...
@@ -27,7 +27,7 @@ from theano.link.c.cmodule import get_module_cache as _get_module_cache
...
@@ -27,7 +27,7 @@ from theano.link.c.cmodule import get_module_cache as _get_module_cache
from
theano.link.utils
import
gc_helper
,
map_storage
,
raise_with_op
,
streamline
from
theano.link.utils
import
gc_helper
,
map_storage
,
raise_with_op
,
streamline
_logger
=
logging
.
getLogger
(
"theano.link.c.
c
c"
)
_logger
=
logging
.
getLogger
(
"theano.link.c.
basi
c"
)
run_cthunk
=
None
# Will be imported only when needed.
run_cthunk
=
None
# Will be imported only when needed.
...
...
theano/scan/op.py
浏览文件 @
fb6b8625
...
@@ -63,7 +63,7 @@ from theano.gof import Apply, PureOp
...
@@ -63,7 +63,7 @@ from theano.gof import Apply, PureOp
from
theano.gof.graph
import
equal_computations
,
io_connection_pattern
from
theano.gof.graph
import
equal_computations
,
io_connection_pattern
from
theano.gof.toolbox
import
NoOutputFromInplace
from
theano.gof.toolbox
import
NoOutputFromInplace
from
theano.gradient
import
DisconnectedType
,
NullType
,
grad_undefined
from
theano.gradient
import
DisconnectedType
,
NullType
,
grad_undefined
from
theano.link.c.
c
c
import
CLinker
from
theano.link.c.
basi
c
import
CLinker
from
theano.link.c.exceptions
import
MissingGXX
from
theano.link.c.exceptions
import
MissingGXX
from
theano.link.utils
import
raise_with_op
from
theano.link.utils
import
raise_with_op
from
theano.scan.utils
import
Validator
,
forced_replace
,
hash_listsDictsTuples
,
safe_new
from
theano.scan.utils
import
Validator
,
forced_replace
,
hash_listsDictsTuples
,
safe_new
...
...
theano/tensor/elemwise.py
浏览文件 @
fb6b8625
...
@@ -1037,7 +1037,7 @@ second dimension
...
@@ -1037,7 +1037,7 @@ second dimension
if
self
.
openmp
:
if
self
.
openmp
:
# If we are using openmp, we need to get rid of the "goto"
# If we are using openmp, we need to get rid of the "goto"
# statement in sub['fail']. For now we recreate it here.
# statement in sub['fail']. For now we recreate it here.
fail
=
theano
.
link
.
c
.
c
c
.
failure_code
(
sub
,
use_goto
=
False
)
fail
=
theano
.
link
.
c
.
basi
c
.
failure_code
(
sub
,
use_goto
=
False
)
else
:
else
:
fail
=
sub
[
"fail"
]
fail
=
sub
[
"fail"
]
task_code
=
self
.
scalar_op
.
c_code
(
task_code
=
self
.
scalar_op
.
c_code
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论