models.modules.Up

Contents

models.modules.Up#

class Up(scale: int = 2, mode: str = 'nearest')[source]#

Bases: LayerGen

Upsample layer generator

Uses torch.nn.Upsample module.

Parameters:
  • scale (int, optional) – Multiplier for spatial size. Defaults to 2.

  • mode (str, optional) – The upsampling algorithm: one of ‘nearest’, ‘linear’, ‘bilinear’, ‘bicubic’ and ‘trilinear’. Defaults to “nearest”.

Methods

get

Initializes and returns the network layer

get(in_channels: int) Tuple[Module, int][source]#

Initializes and returns the network layer

Parameters:

in_channels (int) – Number of input channels.

Returns:

The generated module and the number of channels that will be after applying this layer to a tensor with in_channels channels.

Return type:

Tuple[nn.Module, int]