UpSample2x#

class UpSample2x[source]#

A layer to scale input by a factor of 2.

This layer uses Kronecker product underneath rather than the default pytorch interpolation.

Methods

forward

Logic for using layers defined in init.

Attributes

forward(x)[source]#

Logic for using layers defined in init.

Parameters:

x (torch.Tensor) – Input images, the tensor is in the shape of NCHW.

Returns:

Input images upsampled by a factor of 2 via nearest neighbour interpolation. The tensor is the shape as NCHW.

Return type:

torch.Tensor