diff --git a/python_module/megengine/random/distribution.py b/python_module/megengine/random/distribution.py index 6565dd08e7fe9a75bd26844a633502a46c9e8af7..55977f9c5c23575af2ae97131aac3a4c47f10b88 100644 --- a/python_module/megengine/random/distribution.py +++ b/python_module/megengine/random/distribution.py @@ -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(