nip.utils.torch.ResNetBottleneckBlockSimulateBatchDims

nip.utils.torch.ResNetBottleneckBlockSimulateBatchDims#

class nip.utils.torch.ResNetBottleneckBlockSimulateBatchDims(inplanes: int, planes: int, stride: int = 1, downsample: Module | None = None, groups: int = 1, base_width: int = 64, dilation: int = 1, norm_layer: Callable[[...], Module] | None = None)[source]#

ResNet bottleneck block with arbitrary batch dimensions.

This is a subclass of the Bottleneck module from torchvision’s ResNet implementation: ResNet. The Bottleneck module is not documented, but you can see the source code here.

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

expansion

feature_dims

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.