Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
242fcbfb
提交
242fcbfb
authored
2月 13, 2012
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Another test for Ger
上级
fedca15d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
25 行增加
和
2 行删除
+25
-2
test_blas.py
theano/sandbox/cuda/tests/test_blas.py
+20
-0
test_blas.py
theano/tensor/tests/test_blas.py
+5
-2
没有找到文件。
theano/sandbox/cuda/tests/test_blas.py
浏览文件 @
242fcbfb
...
@@ -390,6 +390,26 @@ class TestGpuGer(TestGer):
...
@@ -390,6 +390,26 @@ class TestGpuGer(TestGer):
self
.
ger
=
gpu_ger_inplace
self
.
ger
=
gpu_ger_inplace
self
.
gemm
=
tcn
.
blas
.
gpu_gemm_inplace
self
.
gemm
=
tcn
.
blas
.
gpu_gemm_inplace
class
TestGpuGerNoTransfer
(
TestGer
):
@staticmethod
def
shared
(
val
):
try
:
return
tcn
.
shared_constructor
(
val
)
except
TypeError
:
return
theano
.
shared
(
val
)
def
setUp
(
self
):
self
.
mode
=
mode_with_gpu
dtype
=
self
.
dtype
=
'float32'
# optimization isn't dtype-dependent
self
.
A
=
tensor
.
tensor
(
dtype
=
dtype
,
broadcastable
=
(
False
,
False
))
self
.
a
=
tensor
.
tensor
(
dtype
=
dtype
,
broadcastable
=
())
self
.
x
=
tensor
.
tensor
(
dtype
=
dtype
,
broadcastable
=
(
False
,))
self
.
y
=
tensor
.
tensor
(
dtype
=
dtype
,
broadcastable
=
(
False
,))
# data on the gpu make the op always inplace
self
.
ger
=
gpu_ger_inplace
self
.
ger_destructive
=
gpu_ger_inplace
self
.
gemm
=
tcn
.
blas
.
gpu_gemm_inplace
class
TestGpuGer_OpContract
(
TestCase
,
unittest_tools
.
T_OpContractMixin
):
class
TestGpuGer_OpContract
(
TestCase
,
unittest_tools
.
T_OpContractMixin
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
theano/tensor/tests/test_blas.py
浏览文件 @
242fcbfb
...
@@ -1355,6 +1355,7 @@ class TestGer_OpContract(TestCase, unittest_tools.T_OpContractMixin):
...
@@ -1355,6 +1355,7 @@ class TestGer_OpContract(TestCase, unittest_tools.T_OpContractMixin):
class
TestGer
(
TestCase
,
unittest_tools
.
TestOptimizationMixin
):
class
TestGer
(
TestCase
,
unittest_tools
.
TestOptimizationMixin
):
shared
=
staticmethod
(
theano
.
shared
)
def
setUp
(
self
):
def
setUp
(
self
):
self
.
mode
=
theano
.
compile
.
get_default_mode
()
.
including
(
'fast_run'
)
self
.
mode
=
theano
.
compile
.
get_default_mode
()
.
including
(
'fast_run'
)
...
@@ -1480,7 +1481,7 @@ class TestGer(TestCase, unittest_tools.TestOptimizationMixin):
...
@@ -1480,7 +1481,7 @@ class TestGer(TestCase, unittest_tools.TestOptimizationMixin):
return
self
.
given_dtype
(
'complex128'
,
1
,
9
)
return
self
.
given_dtype
(
'complex128'
,
1
,
9
)
def
test_inplace
(
self
):
def
test_inplace
(
self
):
A
=
theano
.
shared
(
numpy
.
random
.
rand
(
4
,
5
)
.
astype
(
self
.
dtype
))
A
=
self
.
shared
(
numpy
.
random
.
rand
(
4
,
5
)
.
astype
(
self
.
dtype
))
f
=
self
.
function
([
self
.
x
,
self
.
y
],
[],
f
=
self
.
function
([
self
.
x
,
self
.
y
],
[],
updates
=
{
A
:
A
+
T
.
constant
(
0.1
,
dtype
=
self
.
dtype
)
*
updates
=
{
A
:
A
+
T
.
constant
(
0.1
,
dtype
=
self
.
dtype
)
*
T
.
outer
(
self
.
x
,
self
.
y
)})
T
.
outer
(
self
.
x
,
self
.
y
)})
...
@@ -1488,6 +1489,8 @@ class TestGer(TestCase, unittest_tools.TestOptimizationMixin):
...
@@ -1488,6 +1489,8 @@ class TestGer(TestCase, unittest_tools.TestOptimizationMixin):
f
(
numpy
.
random
.
rand
(
4
)
.
astype
(
self
.
dtype
),
f
(
numpy
.
random
.
rand
(
4
)
.
astype
(
self
.
dtype
),
numpy
.
random
.
rand
(
5
)
.
astype
(
self
.
dtype
))
numpy
.
random
.
rand
(
5
)
.
astype
(
self
.
dtype
))
A
.
set_value
(
A
.
get_value
(
borrow
=
True
)[::
-
1
,
::
-
1
],
borrow
=
True
)
A
.
set_value
(
A
.
get_value
(
borrow
=
True
,
return_internal_type
=
True
)[::
-
1
,
::
-
1
],
borrow
=
True
)
f
(
numpy
.
random
.
rand
(
4
)
.
astype
(
self
.
dtype
),
f
(
numpy
.
random
.
rand
(
4
)
.
astype
(
self
.
dtype
),
numpy
.
random
.
rand
(
5
)
.
astype
(
self
.
dtype
))
numpy
.
random
.
rand
(
5
)
.
astype
(
self
.
dtype
))
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论