Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
b9dd76cf
提交
b9dd76cf
authored
10月 06, 2017
作者:
notoraptor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix typos.
上级
8d307b48
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
9 行增加
和
10 行删除
+9
-10
blas_headers.py
theano/tensor/blas_headers.py
+1
-1
alt_blas_template.c
theano/tensor/c_code/alt_blas_template.c
+6
-6
test_blas.py
theano/tensor/tests/test_blas.py
+2
-3
没有找到文件。
theano/tensor/blas_headers.py
浏览文件 @
b9dd76cf
...
@@ -1033,7 +1033,7 @@ def openblas_threads_text():
...
@@ -1033,7 +1033,7 @@ def openblas_threads_text():
def
blas_header_version
():
def
blas_header_version
():
# Version for the base header
# Version for the base header
version
=
(
8
,)
version
=
(
9
,)
if
detect_macos_sdot_bug
():
if
detect_macos_sdot_bug
():
if
detect_macos_sdot_bug
.
fix_works
:
if
detect_macos_sdot_bug
.
fix_works
:
# Version with fix
# Version with fix
...
...
theano/tensor/c_code/alt_blas_template.c
浏览文件 @
b9dd76cf
/** Alternative template NumPy-based implementation of BLAS functions used in Theano. **/
/** Alternative template NumPy-based implementation of BLAS functions used in Theano. **/
/* Compute
tensor[i] = scalar for every position i in tensor
. */
/* Compute
matrix[i][j] = scalar for every position (i, j) in matrix
. */
void
alt_numpy_memset_inplace_
%
(
float_type
)
s
(
PyArrayObject
*
tensor
,
const
%
(
float_type
)
s
*
scalar
)
{
void
alt_numpy_memset_inplace_
%
(
float_type
)
s
(
PyArrayObject
*
matrix
,
const
%
(
float_type
)
s
*
scalar
)
{
if
(
PyArray_IS_C_CONTIGUOUS
(
tensor
)
&&
*
scalar
==
(
char
)(
*
scalar
))
{
if
(
PyArray_IS_C_CONTIGUOUS
(
matrix
)
&&
*
scalar
==
(
char
)(
*
scalar
))
{
// This will use memset.
// This will use memset.
PyArray_FILLWBYTE
(
tensor
,
(
char
)(
*
scalar
));
PyArray_FILLWBYTE
(
matrix
,
(
char
)(
*
scalar
));
return
;
return
;
}
}
NpyIter
*
iterator
=
NpyIter_New
(
tensor
,
NpyIter
*
iterator
=
NpyIter_New
(
matrix
,
NPY_ITER_READWRITE
|
NPY_ITER_EXTERNAL_LOOP
|
NPY_ITER_REFS_OK
,
NPY_ITER_READWRITE
|
NPY_ITER_EXTERNAL_LOOP
|
NPY_ITER_REFS_OK
,
NPY_KEEPORDER
,
NPY_NO_CASTING
,
NULL
);
NPY_KEEPORDER
,
NPY_NO_CASTING
,
NULL
);
if
(
iterator
==
NULL
)
if
(
iterator
==
NULL
)
alt_fatal_error
(
"Unable to iterate over a
tensor
for a memory assignation."
);
alt_fatal_error
(
"Unable to iterate over a
matrix
for a memory assignation."
);
NpyIter_IterNextFunc
*
get_next
=
NpyIter_GetIterNext
(
iterator
,
NULL
);
NpyIter_IterNextFunc
*
get_next
=
NpyIter_GetIterNext
(
iterator
,
NULL
);
char
**
data_ptr
=
NpyIter_GetDataPtrArray
(
iterator
);
char
**
data_ptr
=
NpyIter_GetDataPtrArray
(
iterator
);
npy_intp
*
stride_ptr
=
NpyIter_GetInnerStrideArray
(
iterator
);
npy_intp
*
stride_ptr
=
NpyIter_GetInnerStrideArray
(
iterator
);
...
...
theano/tensor/tests/test_blas.py
浏览文件 @
b9dd76cf
...
@@ -7,7 +7,7 @@ import numpy as np
...
@@ -7,7 +7,7 @@ import numpy as np
from
numpy
import
(
arange
,
array
,
common_type
,
complex64
,
complex128
,
float32
,
from
numpy
import
(
arange
,
array
,
common_type
,
complex64
,
complex128
,
float32
,
float64
,
newaxis
,
shape
,
transpose
,
zeros
)
float64
,
newaxis
,
shape
,
transpose
,
zeros
)
from
numpy.testing
import
assert_array_almost_equal
from
numpy.testing
import
assert_array_almost_equal
from
itertools
import
product
from
six.moves
import
xrange
from
six.moves
import
xrange
import
theano
import
theano
...
@@ -373,7 +373,7 @@ class t_gemm(TestCase):
...
@@ -373,7 +373,7 @@ class t_gemm(TestCase):
1
,
0
,
2
)),
dt
=
'float32'
)
1
,
0
,
2
)),
dt
=
'float32'
)
class
t_gemm_no_f
lags
(
object
):
class
TestGemmNoF
lags
(
object
):
gemm
=
gemm_no_inplace
gemm
=
gemm_no_inplace
M
=
4
M
=
4
N
=
5
N
=
5
...
@@ -455,7 +455,6 @@ class t_gemm_no_flags(object):
...
@@ -455,7 +455,6 @@ class t_gemm_no_flags(object):
unittest_tools
.
assert_allclose
(
ref_val
,
z_val
)
unittest_tools
.
assert_allclose
(
ref_val
,
z_val
)
def
test_gemm
(
self
):
def
test_gemm
(
self
):
from
itertools
import
product
dtypes
=
(
'float32'
,
'float64'
)
dtypes
=
(
'float32'
,
'float64'
)
scalars
=
(
0
,
1
,
-
2
)
scalars
=
(
0
,
1
,
-
2
)
booleans
=
(
False
,
True
)
booleans
=
(
False
,
True
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论