提交 9b74e6fc 编写于 作者: M Megvii Engine Team 提交者: Xinran Xu

fix(mge/random): add one assert in distribution.py

low must be less than high in uniform sampling

GitOrigin-RevId: 34c33a1ac97dc46846af9bda33273219669b0ab5
上级 fc4dedc0
......@@ -93,6 +93,8 @@ def uniform(
[0.09365904 0.62957656]]
"""
assert low < high, "Uniform is not defined when low >= high"
comp_node, comp_graph = _use_default_if_none(comp_node, comp_graph)
seed = _random_seed_generator().__next__()
return low + (high - low) * mgb.opr.uniform_rng(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册