Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
dd288e88
提交
dd288e88
authored
10月 17, 2016
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minimum is numpy 1.9.1
上级
0f4be8d9
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
35 行删除
+17
-35
extra_ops.py
theano/tensor/extra_ops.py
+0
-6
test_elemwise.py
theano/tensor/tests/test_elemwise.py
+2
-1
test_extra_ops.py
theano/tensor/tests/test_extra_ops.py
+15
-28
没有找到文件。
theano/tensor/extra_ops.py
浏览文件 @
dd288e88
...
...
@@ -575,12 +575,6 @@ class BinCountOp(theano.Op):
def
__init__
(
self
,
minlength
=
None
):
self
.
minlength
=
minlength
if
minlength
is
not
None
:
numpy_ver
=
[
int
(
n
)
for
n
in
numpy
.
__version__
.
split
(
'.'
)[:
2
]]
if
not
bool
(
numpy_ver
>=
[
1
,
6
]):
raise
NotImplementedError
(
"BinCountOp with minlength attribute"
" requires NumPy 1.6 or higher."
)
def
make_node
(
self
,
x
,
weights
):
warnings
.
warn
((
...
...
theano/tensor/tests/test_elemwise.py
浏览文件 @
dd288e88
...
...
@@ -826,6 +826,7 @@ class T_reduce_dtype(unittest.TestCase):
uint8
=
'uint64'
,
uint16
=
'uint64'
,
uint32
=
'uint64'
,
float16
=
'float32'
,
float32
=
'float64'
,
complex64
=
'complex128'
,
)
.
get
(
dtype
,
dtype
)
...
...
@@ -967,7 +968,7 @@ class T_mean_dtype(unittest.TestCase):
pass
else
:
# Executed if no TypeError was raised
if
sum_dtype
in
tensor
.
discrete_dtypes
and
axis
!=
[]
:
if
sum_dtype
in
tensor
.
discrete_dtypes
:
assert
mean_var
.
dtype
==
'float64'
,
(
(
mean_var
.
dtype
,
sum_dtype
))
else
:
...
...
theano/tensor/tests/test_extra_ops.py
浏览文件 @
dd288e88
...
...
@@ -18,9 +18,6 @@ from theano import tensor as T
from
theano
import
config
,
tensor
,
function
from
theano.tests.unittest_tools
import
attr
numpy_ver
=
[
int
(
n
)
for
n
in
numpy
.
__version__
.
split
(
'.'
)[:
2
]]
numpy_16
=
bool
(
numpy_ver
>=
[
1
,
6
])
def
test_cpu_contiguous
():
a
=
T
.
fmatrix
(
'a'
)
...
...
@@ -290,8 +287,6 @@ class TestBinCountOp(utt.InferShapeTester):
assert
(
np
.
bincount
(
a
)
==
f1
(
a
))
.
all
()
assert
np
.
allclose
(
np
.
bincount
(
a
,
weights
=
weights
),
f2
(
a
,
weights
))
if
not
numpy_16
:
continue
f3
=
theano
.
function
([
x
],
BinCountOp
(
minlength
=
23
)(
x
,
weights
=
None
))
f4
=
theano
.
function
([
x
],
BinCountOp
(
minlength
=
5
)(
x
,
weights
=
None
))
assert
(
np
.
bincount
(
a
,
minlength
=
23
)
==
f3
(
a
))
.
all
()
...
...
@@ -327,8 +322,6 @@ class TestBinCountOp(utt.InferShapeTester):
1
,
51
,
size
=
(
25
,))
.
astype
(
dtype
)],
self
.
op_class
)
if
not
numpy_16
:
continue
self
.
_compile_and_check
([
x
],
[
BinCountOp
(
minlength
=
60
)(
x
,
weights
=
weights
)],
[
np
.
random
.
randint
(
...
...
@@ -798,13 +791,11 @@ class test_Unique(utt.InferShapeTester):
self
.
ops
=
[
Unique
(),
Unique
(
True
),
Unique
(
False
,
True
),
Unique
(
True
,
True
)]
if
bool
(
numpy_ver
>=
[
1
,
9
]):
self
.
ops
.
extend
([
Unique
(
False
,
False
,
True
),
Unique
(
True
,
False
,
True
),
Unique
(
False
,
True
,
True
),
Unique
(
True
,
True
,
True
)])
Unique
(
True
,
True
),
Unique
(
False
,
False
,
True
),
Unique
(
True
,
False
,
True
),
Unique
(
False
,
True
,
True
),
Unique
(
True
,
True
,
True
)]
def
test_basic_vector
(
self
):
"""
...
...
@@ -816,13 +807,11 @@ class test_Unique(utt.InferShapeTester):
list_outs_expected
=
[[
np
.
unique
(
inp
)],
np
.
unique
(
inp
,
True
),
np
.
unique
(
inp
,
False
,
True
),
np
.
unique
(
inp
,
True
,
True
)]
if
bool
(
numpy_ver
>=
[
1
,
9
]):
list_outs_expected
.
extend
([
np
.
unique
(
inp
,
False
,
False
,
True
),
np
.
unique
(
inp
,
True
,
False
,
True
),
np
.
unique
(
inp
,
False
,
True
,
True
),
np
.
unique
(
inp
,
True
,
True
,
True
)])
np
.
unique
(
inp
,
True
,
True
),
np
.
unique
(
inp
,
False
,
False
,
True
),
np
.
unique
(
inp
,
True
,
False
,
True
),
np
.
unique
(
inp
,
False
,
True
,
True
),
np
.
unique
(
inp
,
True
,
True
,
True
)]
for
op
,
outs_expected
in
zip
(
self
.
ops
,
list_outs_expected
):
f
=
theano
.
function
(
inputs
=
[
x
],
outputs
=
op
(
x
,
return_list
=
True
))
outs
=
f
(
inp
)
...
...
@@ -839,13 +828,11 @@ class test_Unique(utt.InferShapeTester):
list_outs_expected
=
[[
np
.
unique
(
inp
)],
np
.
unique
(
inp
,
True
),
np
.
unique
(
inp
,
False
,
True
),
np
.
unique
(
inp
,
True
,
True
)]
if
bool
(
numpy_ver
>=
[
1
,
9
]):
list_outs_expected
.
extend
([
np
.
unique
(
inp
,
False
,
False
,
True
),
np
.
unique
(
inp
,
True
,
False
,
True
),
np
.
unique
(
inp
,
False
,
True
,
True
),
np
.
unique
(
inp
,
True
,
True
,
True
)])
np
.
unique
(
inp
,
True
,
True
),
np
.
unique
(
inp
,
False
,
False
,
True
),
np
.
unique
(
inp
,
True
,
False
,
True
),
np
.
unique
(
inp
,
False
,
True
,
True
),
np
.
unique
(
inp
,
True
,
True
,
True
)]
for
op
,
outs_expected
in
zip
(
self
.
ops
,
list_outs_expected
):
f
=
theano
.
function
(
inputs
=
[
x
],
outputs
=
op
(
x
,
return_list
=
True
))
outs
=
f
(
inp
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论