Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8ce2395b
提交
8ce2395b
authored
4月 02, 2015
作者:
orhanf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Registered on sandbox/gpuArray/opt.py and sandbox/cuda/opt.py, tests added
上级
b24d1a8d
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
20 行增加
和
1 行删除
+20
-1
opt.py
theano/sandbox/cuda/opt.py
+1
-0
test_opt.py
theano/sandbox/cuda/tests/test_opt.py
+9
-0
opt.py
theano/sandbox/gpuarray/opt.py
+1
-1
test_opt.py
theano/sandbox/gpuarray/tests/test_opt.py
+9
-0
没有找到文件。
theano/sandbox/cuda/opt.py
浏览文件 @
8ce2395b
...
@@ -96,6 +96,7 @@ register_opt()(theano.tensor.opt.local_track_shape_i)
...
@@ -96,6 +96,7 @@ register_opt()(theano.tensor.opt.local_track_shape_i)
register_opt
(
name
=
'gpu_constant_folding'
)(
register_opt
(
name
=
'gpu_constant_folding'
)(
tensor
.
opt
.
constant_folding
)
tensor
.
opt
.
constant_folding
)
register_opt
()(
theano
.
tensor
.
opt
.
local_subtensor_make_vector
)
register_opt
()(
theano
.
tensor
.
opt
.
local_subtensor_make_vector
)
register_opt
(
'unsafe'
)(
theano
.
tensor
.
opt
.
local_remove_all_assert
)
# This is a partial list of CPU ops that can be in some circonstance
# This is a partial list of CPU ops that can be in some circonstance
...
...
theano/sandbox/cuda/tests/test_opt.py
浏览文件 @
8ce2395b
...
@@ -56,6 +56,15 @@ def test_local_assert():
...
@@ -56,6 +56,15 @@ def test_local_assert():
assert
isinstance
(
a_op
[
0
]
.
inputs
[
0
]
.
type
,
CudaNdarrayType
)
assert
isinstance
(
a_op
[
0
]
.
inputs
[
0
]
.
type
,
CudaNdarrayType
)
def
test_local_remove_all_assert
():
x
=
theano
.
tensor
.
fmatrix
()
a
=
theano
.
tensor
.
opt
.
assert_op
(
x
,
theano
.
tensor
.
eq
(
x
,
0
)
.
any
())
f
=
theano
.
function
([
x
],
a
,
mode
=
mode_with_gpu
)
topo
=
f
.
maker
.
fgraph
.
toposort
()
a_op
=
[
n
for
n
in
topo
if
isinstance
(
n
.
op
,
theano
.
tensor
.
opt
.
Assert
)]
assert
len
(
a_op
)
==
0
def
test_int_pow
():
def
test_int_pow
():
a
=
CudaNdarrayType
([
False
])()
a
=
CudaNdarrayType
([
False
])()
...
...
theano/sandbox/gpuarray/opt.py
浏览文件 @
8ce2395b
...
@@ -59,7 +59,7 @@ def register_opt(*tags, **kwargs):
...
@@ -59,7 +59,7 @@ def register_opt(*tags, **kwargs):
return
f
return
f
register_opt
(
'fast_compile'
)(
theano
.
tensor
.
opt
.
local_track_shape_i
)
register_opt
(
'fast_compile'
)(
theano
.
tensor
.
opt
.
local_track_shape_i
)
register_opt
(
'unsafe'
)(
theano
.
tensor
.
opt
.
local_remove_all_assert
)
def
safe_to_gpu
(
x
):
def
safe_to_gpu
(
x
):
if
isinstance
(
x
.
type
,
tensor
.
TensorType
):
if
isinstance
(
x
.
type
,
tensor
.
TensorType
):
...
...
theano/sandbox/gpuarray/tests/test_opt.py
浏览文件 @
8ce2395b
...
@@ -25,6 +25,15 @@ def test_local_assert():
...
@@ -25,6 +25,15 @@ def test_local_assert():
assert
isinstance
(
a_op
[
0
]
.
inputs
[
0
]
.
type
,
GpuArrayType
)
assert
isinstance
(
a_op
[
0
]
.
inputs
[
0
]
.
type
,
GpuArrayType
)
def
test_local_remove_all_assert
():
x
=
theano
.
tensor
.
fmatrix
()
a
=
theano
.
tensor
.
opt
.
assert_op
(
x
,
theano
.
tensor
.
eq
(
x
,
0
)
.
any
())
f
=
theano
.
function
([
x
],
a
,
mode
=
mode_with_gpu
)
topo
=
f
.
maker
.
fgraph
.
toposort
()
a_op
=
[
n
for
n
in
topo
if
isinstance
(
n
.
op
,
theano
.
tensor
.
opt
.
Assert
)]
assert
len
(
a_op
)
==
0
def
test_flatten
():
def
test_flatten
():
m
=
theano
.
tensor
.
fmatrix
()
m
=
theano
.
tensor
.
fmatrix
()
f
=
theano
.
function
([
m
],
m
.
flatten
(),
mode
=
mode_with_gpu
)
f
=
theano
.
function
([
m
],
m
.
flatten
(),
mode
=
mode_with_gpu
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论