mr2.nn.PermutedBlock
- class mr2.nn.PermutedBlock[source]
-
Apply a submodule along selected spatial dimensions.
- __init__(apply_along_dim: Sequence[int], module: Module, features_last: bool = False)[source]
Initialize the PermutedBlock.
- Parameters:
apply_along_dim (
Sequence[int]) – Spatial dimension indices to use when applying the module. These will be moved to the last dimensions.module (
Module) – Module to apply on the selected dims.features_last (
bool, default:False) – If True, the features dimension is assumed to be the last dimension, as common in transformer models.