提交 f4c3e28c authored 作者: happygds's avatar happygds 提交者: GitHub

Update basic.py

上级 2b06f927
...@@ -4223,7 +4223,7 @@ def roll(x, shift, axis=None): ...@@ -4223,7 +4223,7 @@ def roll(x, shift, axis=None):
if x.ndim == 0: if x.ndim == 0:
axis = 0 axis = 0
else: else:
axis = axis % x.ndim + 1 axis = axis % x.ndim
# Shift may be larger than the size of the axis. If so, since the # Shift may be larger than the size of the axis. If so, since the
# roll operation is cyclic, we can take the shift modulo the size # roll operation is cyclic, we can take the shift modulo the size
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论