Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ec61b4ed
提交
ec61b4ed
authored
4月 30, 2012
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
less print in tests.
上级
b8e3cf3f
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
12 行删除
+12
-12
test_blas.py
theano/sandbox/cuda/tests/test_blas.py
+2
-2
test_basic.py
theano/tensor/tests/test_basic.py
+10
-10
没有找到文件。
theano/sandbox/cuda/tests/test_blas.py
浏览文件 @
ec61b4ed
...
...
@@ -238,7 +238,7 @@ if 0:
bval
=
numpy
.
arange
(
0
,
d0
*
d1
)
.
reshape
(
1
,
1
,
d0
,
d1
)
r
=
f
(
bval
)[
0
]
# print bval, bval.shape, border
print
r
,
r
.
shape
#
print r, r.shape
assert
(
ret
==
r
)
.
all
()
...
...
@@ -284,7 +284,7 @@ def test_downsample():
if
float
(
shp
[
3
])
/
ds
[
1
]
>
512
:
continue
for
ignore_border
in
(
True
,
False
):
print
'test_downsample'
,
shp
,
ds
,
ignore_border
#
print 'test_downsample', shp, ds, ignore_border
ds_op
=
DownsampleFactorMax
(
ds
,
ignore_border
=
ignore_border
)
a
=
tcn
.
shared_constructor
(
my_rand
(
*
shp
),
'a'
)
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
ec61b4ed
...
...
@@ -3049,7 +3049,7 @@ class T_Join_and_Split(unittest.TestCase):
s
=
stack
(
a
,
b
,
a
,
b
)
f
=
function
([
a
,
b
],
s
,
mode
=
self
.
mode
)
val
=
f
(
1
,
2
)
print
val
#
print val
self
.
assertTrue
(
numpy
.
all
(
val
==
[
1
,
2
,
1
,
2
]))
topo
=
f
.
maker
.
env
.
toposort
()
assert
len
([
n
for
n
in
topo
if
isinstance
(
n
.
op
,
opt
.
MakeVector
)])
>
0
...
...
@@ -3588,8 +3588,8 @@ class T_add(unittest.TestCase):
(
"/"
,
lambda
x
,
y
:
x
/
y
))
for
s
,
fn
in
tests
:
f
=
inplace_func
([
a
,
b
],
fn
(
a
,
b
))
print
'valid output:'
,
fn
(
a
.
data
,
b
.
data
)
print
'theano output:'
,
f
(
a
.
data
,
b
.
data
)
#
print 'valid output:', fn(a.data, b.data)
#
print 'theano output:', f(a.data, b.data)
self
.
assertTrue
(
a
.
type
.
values_eq_approx
(
fn
(
a
.
data
,
b
.
data
),
f
(
a
.
data
,
b
.
data
)))
def
test_grad_scalar_l
(
self
):
...
...
@@ -4385,8 +4385,8 @@ class TestARange(unittest.TestCase):
df
=
function
([
dstart
,
dstop
],
dout
)
assert
dout
.
dtype
==
dstart
.
type
.
dtype
print
df
(
0.2
,
5.3
)
print
numpy
.
arange
(
0.2
,
5.3
)
#
print df(0.2, 5.3)
#
print numpy.arange(0.2, 5.3)
assert
numpy
.
all
(
df
(
0.2
,
5.3
)
==
numpy
.
arange
(
0.2
,
5.3
))
assert
numpy
.
all
(
df
(
0.8
,
5.3
)
==
numpy
.
arange
(
0.8
,
5.3
))
assert
numpy
.
all
(
df
(
-
0.7
,
5.3
)
==
numpy
.
arange
(
-
0.7
,
5.3
))
...
...
@@ -4957,8 +4957,8 @@ def test_var():
f
=
function
([
a
],
var
(
a
))
a_val
=
numpy
.
arange
(
60
)
.
reshape
(
3
,
4
,
5
)
print
numpy
.
var
(
a_val
)
print
f
(
a_val
)
#
print numpy.var(a_val)
#
print f(a_val)
assert
numpy
.
allclose
(
numpy
.
var
(
a_val
),
f
(
a_val
))
f
=
function
([
a
],
var
(
a
,
axis
=
0
))
...
...
@@ -4994,9 +4994,9 @@ def test_default():
"It is actually a problem of DEBUG_MODE, see #626."
))
def
test_default_state
():
x
,
y
=
scalars
(
'xy'
)
print
config
.
floatX
print
x
.
type
print
y
.
type
#
print config.floatX
#
print x.type
#
print y.type
z
=
default
(
x
,
3.8
)
new_x
=
y
+
z
f
=
function
([
y
,
compile
.
In
(
x
,
update
=
new_x
,
value
=
12.0
)],
new_x
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论