Shortcuts

mmagic.models.editors.pix2pix.pix2pix_modules

Module Contents

Classes

UnetSkipConnectionBlock

Construct a Unet submodule with skip connections, with the following.

class mmagic.models.editors.pix2pix.pix2pix_modules.UnetSkipConnectionBlock(outer_channels, inner_channels, in_channels=None, submodule=None, is_outermost=False, is_innermost=False, norm_cfg=dict(type='BN'), use_dropout=False)[source]

Bases: torch.nn.Module

Construct a Unet submodule with skip connections, with the following.

structure: downsampling - submodule - upsampling.

Parameters
  • outer_channels (int) – Number of channels at the outer conv layer.

  • inner_channels (int) – Number of channels at the inner conv layer.

  • in_channels (int) – Number of channels in input images/features. If is None, equals to outer_channels. Default: None.

  • submodule (UnetSkipConnectionBlock) – Previously constructed submodule. Default: None.

  • is_outermost (bool) – Whether this module is the outermost module. Default: False.

  • is_innermost (bool) – Whether this module is the innermost module. Default: False.

  • norm_cfg (dict) – Config dict to build norm layer. Default: dict(type=’BN’).

  • use_dropout (bool) – Whether to use dropout layers. Default: False.

forward(x)[source]

Forward function.

Parameters

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

Returns

Forward results.

Return type

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.