Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a4cc7dbd
提交
a4cc7dbd
authored
10月 19, 2016
作者:
notoraptor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Flake8 issue corrected.
上级
a4eb981d
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
blas_headers.py
theano/tensor/blas_headers.py
+3
-3
opt.py
theano/tensor/nnet/opt.py
+3
-3
test_abstract_conv.py
theano/tensor/nnet/tests/test_abstract_conv.py
+1
-1
test_corr.py
theano/tensor/nnet/tests/test_corr.py
+1
-1
没有找到文件。
theano/tensor/blas_headers.py
浏览文件 @
a4cc7dbd
...
@@ -736,7 +736,7 @@ def blas_header_text():
...
@@ -736,7 +736,7 @@ def blas_header_text():
if
not
config
.
blas
.
ldflags
:
if
not
config
.
blas
.
ldflags
:
# Include the Numpy version implementation of [sd]gemm_.
# Include the Numpy version implementation of [sd]gemm_.
current_filedir
=
dirname
(
__file__
)
current_filedir
=
dirname
(
__file__
)
gemm_common_filepath
=
normpath
(
current_filedir
+
"/alt_gemm_common.c"
)
gemm_common_filepath
=
normpath
(
current_filedir
+
"/alt_gemm_common.c"
)
gemm_template_filepath
=
normpath
(
current_filedir
+
"/alt_gemm_template.c"
)
gemm_template_filepath
=
normpath
(
current_filedir
+
"/alt_gemm_template.c"
)
common_code
=
""
common_code
=
""
sgemm_code
=
""
sgemm_code
=
""
...
@@ -745,8 +745,8 @@ def blas_header_text():
...
@@ -745,8 +745,8 @@ def blas_header_text():
common_code
=
code
.
read
()
common_code
=
code
.
read
()
with
open
(
gemm_template_filepath
)
as
code
:
with
open
(
gemm_template_filepath
)
as
code
:
template_code
=
code
.
read
()
template_code
=
code
.
read
()
sgemm_code
=
template_code
%
{
"float_type"
:
"float"
,
"float_size"
:
4
,
"npy_float"
:
"NPY_FLOAT32"
,
"name"
:
"sgemm_"
}
sgemm_code
=
template_code
%
{
"float_type"
:
"float"
,
"float_size"
:
4
,
"npy_float"
:
"NPY_FLOAT32"
,
"name"
:
"sgemm_"
}
dgemm_code
=
template_code
%
{
"float_type"
:
"double"
,
"float_size"
:
8
,
"npy_float"
:
"NPY_FLOAT64"
,
"name"
:
"dgemm_"
}
dgemm_code
=
template_code
%
{
"float_type"
:
"double"
,
"float_size"
:
8
,
"npy_float"
:
"NPY_FLOAT64"
,
"name"
:
"dgemm_"
}
if
not
common_code
or
not
sgemm_code
:
if
not
common_code
or
not
sgemm_code
:
raise
IOError
(
"Unable to load NumPy implementation of gemm code from C source files."
)
raise
IOError
(
"Unable to load NumPy implementation of gemm code from C source files."
)
else
:
else
:
...
...
theano/tensor/nnet/opt.py
浏览文件 @
a4cc7dbd
...
@@ -98,7 +98,7 @@ def local_abstractconv_gemm(node):
...
@@ -98,7 +98,7 @@ def local_abstractconv_gemm(node):
def
local_abstractconv3d_gemm
(
node
):
def
local_abstractconv3d_gemm
(
node
):
# If theano.config.blas.ldflags is empty, Theano will use
# If theano.config.blas.ldflags is empty, Theano will use
# a NumPy C implementation of [sd]gemm_.
# a NumPy C implementation of [sd]gemm_.
if
theano
.
config
.
cxx
==
""
:
# or not theano.config.blas.ldflags:
if
theano
.
config
.
cxx
==
""
:
# or not theano.config.blas.ldflags:
return
return
if
not
isinstance
(
node
.
op
,
AbstractConv3d
):
if
not
isinstance
(
node
.
op
,
AbstractConv3d
):
return
None
return
None
...
@@ -145,7 +145,7 @@ def local_abstractconv_gradweight_gemm(node):
...
@@ -145,7 +145,7 @@ def local_abstractconv_gradweight_gemm(node):
@local_optimizer
([
AbstractConv3d_gradWeights
])
@local_optimizer
([
AbstractConv3d_gradWeights
])
def
local_abstractconv3d_gradweight_gemm
(
node
):
def
local_abstractconv3d_gradweight_gemm
(
node
):
if
theano
.
config
.
cxx
==
""
:
# or not theano.config.blas.ldflags:
if
theano
.
config
.
cxx
==
""
:
# or not theano.config.blas.ldflags:
return
return
if
not
isinstance
(
node
.
op
,
AbstractConv3d_gradWeights
):
if
not
isinstance
(
node
.
op
,
AbstractConv3d_gradWeights
):
return
None
return
None
...
@@ -193,7 +193,7 @@ def local_abstractconv_gradinputs_gemm(node):
...
@@ -193,7 +193,7 @@ def local_abstractconv_gradinputs_gemm(node):
@local_optimizer
([
AbstractConv3d_gradInputs
])
@local_optimizer
([
AbstractConv3d_gradInputs
])
def
local_abstractconv3d_gradinputs_gemm
(
node
):
def
local_abstractconv3d_gradinputs_gemm
(
node
):
if
theano
.
config
.
cxx
==
""
:
# or not theano.config.blas.ldflags:
if
theano
.
config
.
cxx
==
""
:
# or not theano.config.blas.ldflags:
return
return
if
not
isinstance
(
node
.
op
,
AbstractConv3d_gradInputs
):
if
not
isinstance
(
node
.
op
,
AbstractConv3d_gradInputs
):
return
None
return
None
...
...
theano/tensor/nnet/tests/test_abstract_conv.py
浏览文件 @
a4cc7dbd
...
@@ -918,7 +918,7 @@ class TestBilinearUpsampling(unittest.TestCase):
...
@@ -918,7 +918,7 @@ class TestBilinearUpsampling(unittest.TestCase):
if
theano
.
config
.
mode
==
"FAST_COMPILE"
:
if
theano
.
config
.
mode
==
"FAST_COMPILE"
:
compile_mode
=
compile_mode
.
excluding
(
"conv_gemm"
)
compile_mode
=
compile_mode
.
excluding
(
"conv_gemm"
)
compile_mode
=
compile_mode
.
excluding
(
'AbstractConvCheck'
)
compile_mode
=
compile_mode
.
excluding
(
'AbstractConvCheck'
)
elif
not
theano
.
config
.
cxx
:
# not theano.config.blas.ldflags or
elif
not
theano
.
config
.
cxx
:
# not theano.config.blas.ldflags or
compile_mode
=
compile_mode
.
excluding
(
'AbstractConvCheck'
)
compile_mode
=
compile_mode
.
excluding
(
'AbstractConvCheck'
)
def
numerical_kernel_1D
(
self
,
ratio
):
def
numerical_kernel_1D
(
self
,
ratio
):
...
...
theano/tensor/nnet/tests/test_corr.py
浏览文件 @
a4cc7dbd
...
@@ -131,7 +131,7 @@ class TestCorr2D(utt.InferShapeTester):
...
@@ -131,7 +131,7 @@ class TestCorr2D(utt.InferShapeTester):
icol
:
icol
+
dil_fil_shape2d
[
1
]:
filter_dilation
[
1
]]
*
filter2d
[::
-
1
,
::
-
1
]
icol
:
icol
+
dil_fil_shape2d
[
1
]:
filter_dilation
[
1
]]
*
filter2d
[::
-
1
,
::
-
1
]
)
.
sum
()
)
.
sum
()
#utt.assert_allclose(theano_output, ref_output)
#
utt.assert_allclose(theano_output, ref_output)
utt
.
assert_allclose
(
ref_output
,
theano_output
)
utt
.
assert_allclose
(
ref_output
,
theano_output
)
# TEST GRADIENT
# TEST GRADIENT
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论