提交 5b3b5418 authored 作者: David Warde-Farley's avatar David Warde-Farley

Better docstring for roll.

NumPy docstring standard compliant. Nearly identical to the numpy.roll docstring.
上级 22ef48cb
...@@ -4298,13 +4298,19 @@ def roll(x, shift, axis=None): ...@@ -4298,13 +4298,19 @@ def roll(x, shift, axis=None):
Parameters Parameters
---------- ----------
- x : a Tensor x : tensor_like
- shift : int (symbolic or literal) Input tensor.
The number of places by which elements are shifted shift : int (symbolic or literal)
- axis : int (symbolic or literal) (optional) The number of places by which elements are shifted.
The axis along which elements are shifted. axis : int (symbolic or literal) (optional)
Defaults to zero (deviation from numpy behavior) The axis along which elements are shifted. By default, the array
Defaults to flattening first, rolling, and then reshaping. is flattened before shifting, after which the original
shape is restored.
Returns
-------
res : tensor
Output tensor, with the same shape as `x`.
""" """
if axis is None: if axis is None:
y = x.flatten() y = x.flatten()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论