Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5b58807d
提交
5b58807d
authored
7月 05, 2021
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
7月 07, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor random tests and include explicit broadcasting tests
上级
87bc36c7
全部展开
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
9 行增加
和
6 行删除
+9
-6
basic.py
aesara/tensor/random/basic.py
+1
-2
op.py
aesara/tensor/random/op.py
+0
-4
test_basic.py
tests/tensor/random/test_basic.py
+0
-0
unittest_tools.py
tests/unittest_tools.py
+8
-0
没有找到文件。
aesara/tensor/random/basic.py
浏览文件 @
5b58807d
...
@@ -29,8 +29,7 @@ except AttributeError:
...
@@ -29,8 +29,7 @@ except AttributeError:
from
numpy.lib.stride_tricks
import
_broadcast_shape
from
numpy.lib.stride_tricks
import
_broadcast_shape
def
broadcast_shapes
(
*
shapes
):
def
broadcast_shapes
(
*
shapes
):
arrays
=
[
np
.
empty
(
x
,
dtype
=
[])
for
x
in
shapes
]
return
_broadcast_shape
(
*
[
np
.
empty
(
x
,
dtype
=
[])
for
x
in
shapes
])
return
_broadcast_shape
(
arrays
)
class
ScipyRandomVariable
(
RandomVariable
):
class
ScipyRandomVariable
(
RandomVariable
):
...
...
aesara/tensor/random/op.py
浏览文件 @
5b58807d
...
@@ -330,10 +330,6 @@ class RandomVariable(Op):
...
@@ -330,10 +330,6 @@ class RandomVariable(Op):
def
make_node
(
self
,
rng
,
size
,
dtype
,
*
dist_params
):
def
make_node
(
self
,
rng
,
size
,
dtype
,
*
dist_params
):
"""Create a random variable node.
"""Create a random variable node.
XXX: Unnamed/non-keyword arguments are considered distribution
parameters! If you want to set `size`, `rng`, and/or `name`, use their
keywords.
Parameters
Parameters
----------
----------
rng: RandomGeneratorType or RandomStateType
rng: RandomGeneratorType or RandomStateType
...
...
tests/tensor/random/test_basic.py
浏览文件 @
5b58807d
差异被折叠。
点击展开。
tests/unittest_tools.py
浏览文件 @
5b58807d
...
@@ -10,6 +10,7 @@ import aesara
...
@@ -10,6 +10,7 @@ import aesara
from
aesara.compile.debugmode
import
str_diagnostic
from
aesara.compile.debugmode
import
str_diagnostic
from
aesara.configdefaults
import
config
from
aesara.configdefaults
import
config
from
aesara.gradient
import
verify_grad
as
orig_verify_grad
from
aesara.gradient
import
verify_grad
as
orig_verify_grad
from
aesara.tensor.basic
import
as_tensor_variable
from
aesara.tensor.math
import
_allclose
from
aesara.tensor.math
import
_allclose
from
aesara.tensor.math
import
add
as
aet_add
from
aesara.tensor.math
import
add
as
aet_add
...
@@ -392,3 +393,10 @@ def assertFailure_fast(f):
...
@@ -392,3 +393,10 @@ def assertFailure_fast(f):
return
test_with_assert
return
test_with_assert
else
:
else
:
return
f
return
f
def
create_aesara_param
(
param_value
):
"""Create a `Variable` from a value and set its test value."""
p_aet
=
as_tensor_variable
(
param_value
)
.
type
()
p_aet
.
tag
.
test_value
=
param_value
return
p_aet
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论