Shortcuts

mmagic.models.archs.upsample

Module Contents

Classes

PixelShufflePack

Pixel Shuffle upsample layer.

class mmagic.models.archs.upsample.PixelShufflePack(in_channels: int, out_channels: int, scale_factor: int, upsample_kernel: int)[源代码]

Bases: torch.nn.Module

Pixel Shuffle upsample layer.

参数
  • in_channels (int) – Number of input channels.

  • out_channels (int) – Number of output channels.

  • scale_factor (int) – Upsample ratio.

  • upsample_kernel (int) – Kernel size of Conv layer to expand channels.

返回

Upsampled feature map.

init_weights() None[源代码]

Initialize weights for PixelShufflePack.

forward(x: torch.Tensor) torch.Tensor[源代码]

Forward function for PixelShufflePack.

参数

x (Tensor) – Input tensor with shape (n, c, h, w).

返回

Forward results.

返回类型

Tensor

Read the Docs v: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.