Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d6479fdb
提交
d6479fdb
authored
3月 19, 2012
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
small typo/cleaner code following review comments
上级
da2182ef
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
10 行增加
和
10 行删除
+10
-10
NEWS.txt
NEWS.txt
+2
-2
rng_mrg.py
theano/sandbox/rng_mrg.py
+4
-4
test_rng_mrg.py
theano/sandbox/test_rng_mrg.py
+4
-4
没有找到文件。
NEWS.txt
浏览文件 @
d6479fdb
...
@@ -32,8 +32,8 @@ New Features
...
@@ -32,8 +32,8 @@ New Features
* If you use Enthought Python Distribution (EPD) now we use its blas
* If you use Enthought Python Distribution (EPD) now we use its blas
implementation by default (tested on Linux and Windows)
implementation by default (tested on Linux and Windows)
(Frederic B., Simon McGregor)
(Frederic B., Simon McGregor)
* MRG random now raise an error with a clear message when the passed shape
* MRG random now raise
s
an error with a clear message when the passed shape
contain dimensions with bad value like 0. (Frédéric B. reported by Ian G.)
contain
s
dimensions with bad value like 0. (Frédéric B. reported by Ian G.)
Sparse Sandbox graduate
Sparse Sandbox graduate
* Remove0 op: it removes stored elements with value 0. (Frederic B.)
* Remove0 op: it removes stored elements with value 0. (Frederic B.)
...
...
theano/sandbox/rng_mrg.py
浏览文件 @
d6479fdb
...
@@ -730,9 +730,9 @@ class MRG_RandomStreams(object):
...
@@ -730,9 +730,9 @@ class MRG_RandomStreams(object):
msg
=
"size must be a tuple of int or a Theano variable"
msg
=
"size must be a tuple of int or a Theano variable"
assert
all
([
isinstance
(
i
,
int
)
or
isinstance
(
i
,
Variable
)
assert
all
([
isinstance
(
i
,
int
)
or
isinstance
(
i
,
Variable
)
for
i
in
size
]),
msg
for
i
in
size
]),
msg
if
len
([
i
for
i
in
size
if
isinstance
(
i
,
int
)
and
i
<=
0
])
>
0
:
if
any
([
isinstance
(
i
,
int
)
and
i
<=
0
for
i
in
size
])
:
raise
ValueError
(
raise
ValueError
(
"The specified size contain a dimension with value <= 0"
,
"The specified size contain
s
a dimension with value <= 0"
,
size
)
size
)
else
:
else
:
...
@@ -803,9 +803,9 @@ class MRG_RandomStreams(object):
...
@@ -803,9 +803,9 @@ class MRG_RandomStreams(object):
raise
TypeError
(
"You have to specify pvals"
)
raise
TypeError
(
"You have to specify pvals"
)
pvals
=
as_tensor_variable
(
pvals
)
pvals
=
as_tensor_variable
(
pvals
)
if
size
is
not
None
:
if
size
is
not
None
:
if
any
([
i
for
i
in
size
if
not
(
isinstance
(
i
,
int
)
and
i
<=
0
)
]):
if
any
([
i
sinstance
(
i
,
int
)
and
i
<=
0
for
i
in
size
]):
raise
ValueError
(
raise
ValueError
(
"The specified size contain a dimension with value <= 0"
,
"The specified size contain
s
a dimension with value <= 0"
,
size
)
size
)
if
n
==
1
and
pvals
.
ndim
==
2
:
if
n
==
1
and
pvals
.
ndim
==
2
:
...
...
theano/sandbox/test_rng_mrg.py
浏览文件 @
d6479fdb
...
@@ -604,10 +604,10 @@ class T_MRG(unittest.TestCase):
...
@@ -604,10 +604,10 @@ class T_MRG(unittest.TestCase):
R
=
MRG_RandomStreams
(
234
,
use_cuda
=
False
)
R
=
MRG_RandomStreams
(
234
,
use_cuda
=
False
)
for
size
,
var_input
in
[
for
size
in
[
(
(
0
,
100
),
[]
),
(
0
,
100
),
(
(
-
1
,
100
),
[]
),
(
-
1
,
100
),
(
(
1
,
0
),
[]
),
(
1
,
0
),
]:
]:
self
.
assertRaises
(
ValueError
,
R
.
uniform
,
size
)
self
.
assertRaises
(
ValueError
,
R
.
uniform
,
size
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论