神经性耳鸣有什么症状

paddle.nn.functional. channel_shuffle ( x: Tensor, groups: int, data_format: DataLayout2D = 'NCHW', name: str | None = None ) Tensor [source]
百度 次节比赛,哈德森连续命中两记三分球,韩德君两罚全中,将分差拉开到21分。

This API implements channel shuffle operation. See more details in ChannelShuffle.

Parameters
  • x (Tensor) – 4-D tensor, the data type should be float32 or float64.

  • groups (int) – Number of groups to divide channels in.

  • data_format (str, optional) – The data format of the input and output data. An optional string of NCHW or NHWC. The default is NCHW. When it is NCHW, the data is stored in the order of [batch_size, input_channels, input_height, input_width].

  • name (str|None, optional) – Name for the operation (optional, default is None). Normally there is no need for user to set this property. For more information, please refer to Name.

Returns

Rearranged tensor keeping the original tensor shape.

Return type

Out (Tensor)

Examples

>>> import paddle
>>> import paddle.nn.functional as F
>>> x = paddle.arange(0, 0.6, 0.1, 'float32')
>>> x = paddle.reshape(x, [1, 6, 1, 1])
>>> print(x)
Tensor(shape=[1, 6, 1, 1], dtype=float32, place=Place(cpu), stop_gradient=True,
[[[[0.        ]],
  [[0.10000000]],
  [[0.20000000]],
  [[0.30000001]],
  [[0.40000001]],
  [[0.50000000]]]])
>>> y = F.channel_shuffle(x, 3)
>>> print(y)
Tensor(shape=[1, 6, 1, 1], dtype=float32, place=Place(cpu), stop_gradient=True,
[[[[0.        ]],
  [[0.20000000]],
  [[0.40000001]],
  [[0.10000000]],
  [[0.30000001]],
  [[0.50000000]]]])