polish the docstring of randint_like

This commit is contained in:
lzhengning 2021-02-09 19:07:16 +08:00
parent 87cea7095a
commit 479c1d171c
1 changed files with 7 additions and 4 deletions

View File

@ -540,10 +540,13 @@ def randint_like(x, low, high=None) -> Var:
Example:
>>> x = jt.zeros((2, 3))
>>> jt.randint_like(x)
jt.Var([[-1.1647032 0.34847224 -1.3061888 ]
[ 1.068085 -0.34366122 0.13172573]], dtype=float32)
'''
>>> jt.randint_like(x, 10)
jt.Var([[9. 3. 4.]
[4. 8. 5.]], dtype=float32)
>>> jt.randint_like(x, 10, 20)
jt.Var([[17. 11. 18.]
[14. 17. 15.]], dtype=float32)
'''
return randint(low, high, x.shape, x.dtype)