Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
452e9c92
提交
452e9c92
authored
10月 07, 2015
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix the blas ops so that they really don't need to inherit from the
tensor ones and make GpuGer conform.
上级
5cecb66b
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
19 行增加
和
4 行删除
+19
-4
blas.py
theano/sandbox/gpuarray/blas.py
+17
-2
opt.py
theano/sandbox/gpuarray/opt.py
+1
-1
test_blas.py
theano/sandbox/gpuarray/tests/test_blas.py
+1
-1
没有找到文件。
theano/sandbox/gpuarray/blas.py
浏览文件 @
452e9c92
...
@@ -31,6 +31,11 @@ class BlasOp(HideC):
...
@@ -31,6 +31,11 @@ class BlasOp(HideC):
class
GpuGemv
(
BlasOp
):
class
GpuGemv
(
BlasOp
):
def
__init__
(
self
,
inplace
=
False
):
self
.
inplace
=
inplace
if
self
.
inplace
:
self
.
destroy_map
=
{
0
:
[
0
]}
def
make_node
(
self
,
y
,
alpha
,
A
,
x
,
beta
):
def
make_node
(
self
,
y
,
alpha
,
A
,
x
,
beta
):
ctx_name
=
infer_context_name
(
y
,
A
,
x
)
ctx_name
=
infer_context_name
(
y
,
A
,
x
)
A
=
as_gpuarray_variable
(
A
,
ctx_name
)
A
=
as_gpuarray_variable
(
A
,
ctx_name
)
...
@@ -104,6 +109,11 @@ gpugemv_inplace = GpuGemv(inplace=True)
...
@@ -104,6 +109,11 @@ gpugemv_inplace = GpuGemv(inplace=True)
class
GpuGemm
(
BlasOp
):
class
GpuGemm
(
BlasOp
):
_f16_ok
=
True
_f16_ok
=
True
def
__init__
(
self
,
inplace
=
False
):
self
.
inplace
=
inplace
if
self
.
inplace
:
self
.
destroy_map
=
{
0
:
[
0
]}
def
make_node
(
self
,
C
,
alpha
,
A
,
B
,
beta
):
def
make_node
(
self
,
C
,
alpha
,
A
,
B
,
beta
):
ctx_name
=
infer_context_name
(
C
,
A
,
B
)
ctx_name
=
infer_context_name
(
C
,
A
,
B
)
A
=
as_gpuarray_variable
(
A
,
ctx_name
)
A
=
as_gpuarray_variable
(
A
,
ctx_name
)
...
@@ -175,6 +185,11 @@ gpugemm_inplace = GpuGemm(inplace=True)
...
@@ -175,6 +185,11 @@ gpugemm_inplace = GpuGemm(inplace=True)
class
GpuGer
(
BlasOp
):
class
GpuGer
(
BlasOp
):
def
__init__
(
self
,
inplace
=
False
):
self
.
inplace
=
inplace
if
self
.
inplace
:
self
.
destroy_map
=
{
0
:
[
0
]}
def
make_node
(
self
,
A
,
alpha
,
x
,
y
):
def
make_node
(
self
,
A
,
alpha
,
x
,
y
):
ctx_name
=
infer_context_name
(
A
,
x
,
y
)
ctx_name
=
infer_context_name
(
A
,
x
,
y
)
A
=
as_gpuarray_variable
(
A
,
ctx_name
)
A
=
as_gpuarray_variable
(
A
,
ctx_name
)
...
@@ -236,8 +251,8 @@ class GpuGer(BlasOp):
...
@@ -236,8 +251,8 @@ class GpuGer(BlasOp):
return
(
3
,)
return
(
3
,)
gpuger_no_inplace
=
GpuGer
(
destructiv
e
=
False
)
gpuger_no_inplace
=
GpuGer
(
inplac
e
=
False
)
gpuger_inplace
=
GpuGer
(
destructiv
e
=
True
)
gpuger_inplace
=
GpuGer
(
inplac
e
=
True
)
class
GpuDot22
(
BlasOp
):
class
GpuDot22
(
BlasOp
):
...
...
theano/sandbox/gpuarray/opt.py
浏览文件 @
452e9c92
...
@@ -728,7 +728,7 @@ def local_gpuagemm_output_merge(node, *inputs):
...
@@ -728,7 +728,7 @@ def local_gpuagemm_output_merge(node, *inputs):
@register_opt
(
'fast_compile'
)
@register_opt
(
'fast_compile'
)
@op_lifter
([
tensor
.
blas
.
Ger
,
tensor
.
blas_c
.
CGer
,
tensor
.
blas_scipy
.
ScipyGer
])
@op_lifter
([
tensor
.
blas
.
Ger
,
tensor
.
blas_c
.
CGer
,
tensor
.
blas_scipy
.
ScipyGer
])
def
local_gpua_ger
(
node
,
context_name
):
def
local_gpua_ger
(
node
,
context_name
):
return
GpuGer
(
destructiv
e
=
node
.
op
.
destructive
)
return
GpuGer
(
inplac
e
=
node
.
op
.
destructive
)
@register_opt
(
'fast_compile'
)
@register_opt
(
'fast_compile'
)
...
...
theano/sandbox/gpuarray/tests/test_blas.py
浏览文件 @
452e9c92
...
@@ -100,7 +100,7 @@ class TestGpuGer_OpContract(TestCase, utt.T_OpContractMixin):
...
@@ -100,7 +100,7 @@ class TestGpuGer_OpContract(TestCase, utt.T_OpContractMixin):
self
.
ops
=
[
gpuger_no_inplace
,
gpuger_inplace
]
self
.
ops
=
[
gpuger_no_inplace
,
gpuger_inplace
]
def
clone
(
self
,
op
):
def
clone
(
self
,
op
):
return
GpuGer
(
destructive
=
op
.
destructiv
e
)
return
GpuGer
(
inplace
=
op
.
inplac
e
)
GpuDot22Tester
=
makeTester
(
GpuDot22Tester
=
makeTester
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论