白内障手术后,眼睛不舒服、看不清怎么办?...

paddle. unfold ( x: Tensor, axis: int, size: int, step: int, name: str | None = None ) Tensor [source]
百度 原标题:北京2018年将完成政府网站整合  新华社北京3月24日电(记者乌梦达)记者从北京市政府发布的《2017年北京市政府信息公开工作年度报告》上了解到,2018年北京市将完成政府网站的规范整合工作,推进政府网站集约共享,搭建统一互动交流平台。

View x with specified shape, stride and offset, which contains all slices of size from x in the dimension axis.

Note that the output Tensor will share data with origin Tensor and doesn’t have a Tensor copy in dygraph mode.

Parameters
  • x (Tensor) – An N-D Tensor. The data type is float32, float64, int32, int64 or bool

  • axis (int) – The axis along which the input is unfolded.

  • size (int) – The size of each slice that is unfolded.

  • step (int) – The step between each slice.

  • name (str|None, optional) – Name for the operation (optional, default is None). For more information, please refer to Name.

Returns

Tensor, A unfold Tensor with the same data type as x.

Examples

>>> import paddle
>>> paddle.base.set_flags({"FLAGS_use_stride_kernel": True})

>>> x = paddle.arange(9, dtype="float64")

>>> out = paddle.unfold(x, 0, 2, 4)
>>> print(out)
Tensor(shape=[2, 2], dtype=float64, place=Place(cpu), stop_gradient=True,
[[0., 1.],
 [4., 5.]])