提交 26146e5a 编写于 作者: M Megvii Engine Team

feat(mge/uniform): add the judgment of low and high

GitOrigin-RevId: 21788d199211003ce318606e30ca746cf02bffbc
上级 051a6055
...@@ -106,6 +106,8 @@ def _uniform( ...@@ -106,6 +106,8 @@ def _uniform(
_ref = Tensor([], dtype="int32", device=device) _ref = Tensor([], dtype="int32", device=device)
shape = utils.astensor1d(size, _ref, dtype="int32", device=device) shape = utils.astensor1d(size, _ref, dtype="int32", device=device)
(output,) = apply(op, shape) (output,) = apply(op, shape)
if low == 0 and high == 1:
return output
return low + (high - low) * output return low + (high - low) * output
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册