Upsample

class dragon.vm.torch.nn.Upsample(
  size=None,
  scale_factor=None,
  mode='nearest',
  align_corners=False
)[source]

Upsample input via interpolating neighborhoods.

Examples:

x = torch.ones((1, 2, 3, 4))
y = torch.nn.Upsample(size=6)(x)  # Shape: (1, 2, 6, 6)
z = torch.nn.UpSample(scale_factor=2)(x)  # Shape: (1, 2, 6, 8)

__init__

Upsample.__init__(
  size=None,
  scale_factor=None,
  mode='nearest',
  align_corners=False
)[source]

Create an Upsample module.

Parameters:
  • size (Union[int, Sequence[int]], optional) – The output size.
  • scale_factor (Union[number, Sequence[number]], optional) – The scale factor along each input dimension.
  • mode ({'nearest', 'linear'}, optional) – The interpolation mode.
  • align_corners (bool, optional, default=False) – Whether to align corners in linear interpolating.