提交 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):
Parameters
----------
- x : a Tensor
- shift : int (symbolic or literal)
The number of places by which elements are shifted
- axis : int (symbolic or literal) (optional)
The axis along which elements are shifted.
Defaults to zero (deviation from numpy behavior)
Defaults to flattening first, rolling, and then reshaping.
x : tensor_like
Input tensor.
shift : int (symbolic or literal)
The number of places by which elements are shifted.
axis : int (symbolic or literal) (optional)
The axis along which elements are shifted. By default, the array
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:
y = x.flatten()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论