Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4800a51c
提交
4800a51c
authored
1月 28, 2016
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3940 from abergeron/fix_buildbot
Fix most of the remaining DeprecationWarnings in the tests.
上级
6e25ecf9
7fc2bcbf
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
basic.py
theano/scalar/basic.py
+1
-1
basic.py
theano/tensor/basic.py
+2
-1
test_basic.py
theano/tensor/tests/test_basic.py
+2
-2
test_misc.py
theano/tensor/tests/test_misc.py
+0
-1
test_sort.py
theano/tensor/tests/test_sort.py
+3
-3
没有找到文件。
theano/scalar/basic.py
浏览文件 @
4800a51c
...
@@ -1671,7 +1671,7 @@ class TrueDiv(BinaryScalarOp):
...
@@ -1671,7 +1671,7 @@ class TrueDiv(BinaryScalarOp):
# This is different from it not being connected
# This is different from it not being connected
# to the output; x/y is still a function of x
# to the output; x/y is still a function of x
# and y; it's just a step function.
# and y; it's just a step function.
if
(
x
/
y
)
.
type
in
discrete_types
:
if
all
(
a
.
dtype
in
discrete_types
for
a
in
(
x
,
y
))
:
return
[
x
.
zeros_like
(),
y
.
zeros_like
()]
return
[
x
.
zeros_like
(),
y
.
zeros_like
()]
first_part
=
gz
/
y
first_part
=
gz
/
y
...
...
theano/tensor/basic.py
浏览文件 @
4800a51c
...
@@ -1360,7 +1360,8 @@ class MaxAndArgmax(Op):
...
@@ -1360,7 +1360,8 @@ class MaxAndArgmax(Op):
dtype
=
node
.
outputs
[
0
]
.
dtype
)
dtype
=
node
.
outputs
[
0
]
.
dtype
)
# Numpy does not support multiple axes for argmax
# Numpy does not support multiple axes for argmax
# Work around
# Work around
keep_axes
=
numpy
.
array
([
i
for
i
in
range
(
x
.
ndim
)
if
i
not
in
axes
])
keep_axes
=
numpy
.
array
([
i
for
i
in
range
(
x
.
ndim
)
if
i
not
in
axes
],
dtype
=
'int64'
)
# Not-reduced axes in front
# Not-reduced axes in front
transposed_x
=
numpy
.
transpose
(
x
,
numpy
.
concatenate
((
keep_axes
,
axes
)))
transposed_x
=
numpy
.
transpose
(
x
,
numpy
.
concatenate
((
keep_axes
,
axes
)))
reshaped_x
=
transposed_x
.
reshape
(
transposed_x
.
shape
[:
len
(
keep_axes
)]
+
reshaped_x
=
transposed_x
.
reshape
(
transposed_x
.
shape
[:
len
(
keep_axes
)]
+
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
4800a51c
...
@@ -6791,8 +6791,8 @@ def test_unalign():
...
@@ -6791,8 +6791,8 @@ def test_unalign():
else
:
else
:
dtype
=
"b1,f4"
dtype
=
"b1,f4"
a
=
numpy
.
empty
(
1
e4
,
dtype
=
dtype
)[
'f1'
]
a
=
numpy
.
empty
(
1
0000
,
dtype
=
dtype
)[
'f1'
]
b
=
numpy
.
empty
(
1
e4
,
dtype
=
dtype
)[
'f1'
]
b
=
numpy
.
empty
(
1
0000
,
dtype
=
dtype
)[
'f1'
]
assert
not
a
.
flags
.
aligned
assert
not
a
.
flags
.
aligned
assert
not
b
.
flags
.
aligned
assert
not
b
.
flags
.
aligned
a
[:]
=
rand
(
len
(
a
))
a
[:]
=
rand
(
len
(
a
))
...
...
theano/tensor/tests/test_misc.py
浏览文件 @
4800a51c
...
@@ -12,7 +12,6 @@ def test_bug_2009_06_02_trac_387():
...
@@ -12,7 +12,6 @@ def test_bug_2009_06_02_trac_387():
f
=
theano
.
function
([
y
],
f
=
theano
.
function
([
y
],
tensor
.
int_div
(
tensor
.
int_div
(
tensor
.
DimShuffle
(
y
[
0
]
.
broadcastable
,
[
'x'
])(
y
[
0
]),
2
))
tensor
.
DimShuffle
(
y
[
0
]
.
broadcastable
,
[
'x'
])(
y
[
0
]),
2
))
sys
.
stdout
.
flush
()
print
(
f
(
numpy
.
ones
(
1
,
dtype
=
'int64'
)
*
3
))
print
(
f
(
numpy
.
ones
(
1
,
dtype
=
'int64'
)
*
3
))
# XXX: there is no assert, nor comment that DEBUGMODE is to do the
# XXX: there is no assert, nor comment that DEBUGMODE is to do the
# checking. What was the bug, and how is it being tested?
# checking. What was the bug, and how is it being tested?
...
...
theano/tensor/tests/test_sort.py
浏览文件 @
4800a51c
...
@@ -165,7 +165,7 @@ def test_argsort():
...
@@ -165,7 +165,7 @@ def test_argsort():
# Example 2
# Example 2
a
=
tensor
.
dmatrix
()
a
=
tensor
.
dmatrix
()
axis
=
tensor
.
scalar
()
axis
=
tensor
.
l
scalar
()
w
=
argsort
(
a
,
axis
)
w
=
argsort
(
a
,
axis
)
f
=
theano
.
function
([
a
,
axis
],
w
)
f
=
theano
.
function
([
a
,
axis
],
w
)
for
axis_val
in
0
,
1
:
for
axis_val
in
0
,
1
:
...
@@ -183,7 +183,7 @@ def test_argsort():
...
@@ -183,7 +183,7 @@ def test_argsort():
# Example 4
# Example 4
a
=
tensor
.
dmatrix
()
a
=
tensor
.
dmatrix
()
axis
=
tensor
.
scalar
()
axis
=
tensor
.
l
scalar
()
l
=
argsort
(
a
,
axis
,
"mergesort"
)
l
=
argsort
(
a
,
axis
,
"mergesort"
)
f
=
theano
.
function
([
a
,
axis
],
l
)
f
=
theano
.
function
([
a
,
axis
],
l
)
for
axis_val
in
0
,
1
:
for
axis_val
in
0
,
1
:
...
@@ -193,7 +193,7 @@ def test_argsort():
...
@@ -193,7 +193,7 @@ def test_argsort():
# Example 5
# Example 5
a
=
tensor
.
dmatrix
()
a
=
tensor
.
dmatrix
()
axis
=
tensor
.
scalar
()
axis
=
tensor
.
l
scalar
()
a1
=
ArgSortOp
(
"mergesort"
,
[])
a1
=
ArgSortOp
(
"mergesort"
,
[])
a2
=
ArgSortOp
(
"quicksort"
,
[])
a2
=
ArgSortOp
(
"quicksort"
,
[])
# All the below should give true
# All the below should give true
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论