nip.utils.torch.UpsampleSimulateBatchDims

nip.utils.torch.UpsampleSimulateBatchDims#

class nip.utils.torch.UpsampleSimulateBatchDims(size: int | Tuple[int, ...] | None = None, scale_factor: float | Tuple[float, ...] | None = None, mode: str = 'nearest', align_corners: bool | None = None, recompute_scale_factor: bool | None = None)[source]#

Upsample layer with arbitrary batch dimensions.

See torch.nn.Upsample for documentation.

Assumes an input of shape (… channels height width).

Methods Summary

forward(x)

Apply the module to the input tensor, simulating multiple batch dimensions.

Attributes

T_destination

call_super_init

dump_patches

feature_dims

name

size

scale_factor

mode

align_corners

recompute_scale_factor

training

Methods

forward(x: Tensor) Tensor[source]#

Apply the module to the input tensor, simulating multiple batch dimensions.

Parameters:

x (Tensor) – The input tensor.

Returns:

out (Tensor) – The output tensor after applying the module.