receptive_field_for

class torchelie.nn.utils.receptive_field_for(net: torch.nn.modules.module.Module, input_size: Tuple[int, int, int])

Compute the receptive field of net using a backward pass.

Warning

Make sure the net does not have any normalization operation: mean / std operations impact the whole volume and make the calculation invalid. (BatchNorm is okay in eval mode)

Parameters

input_size (Tuple[int, int, int]) – a (C, H, W) volume size that the model can accept. Note that the receptive field calculation is bounded by this size.

Returns

height and width receptive fields.