Shortcuts

mmedit.models.base_archs.upsample

Module Contents

Classes

PixelShufflePack

Pixel Shuffle upsample layer.

class mmedit.models.base_archs.upsample.PixelShufflePack(in_channels: int, out_channels: int, scale_factor: int, upsample_kernel: int)[source]

Bases: torch.nn.Module

Pixel Shuffle upsample layer.

Parameters
  • 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.

Returns

Upsampled feature map.

init_weights() None[source]

Initialize weights for PixelShufflePack.

forward(x: torch.Tensor) torch.Tensor[source]

Forward function for PixelShufflePack.

Parameters

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

Returns

Forward results.

Return type

Tensor

Read the Docs v: latest
Versions
master
latest
stable
zyh-re-docs
zyh-doc-notfound-extend
zyh-api-rendering
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.