- class sinabs.layers.UnflattenTime(batch_size: int)#
Utility layer which always unflattens (expands) the first dimension into two separate ones. Meant to convert a tensor of dimensions (Batch*Time, Channels, Height, Width) into a tensor of (Batch, Time, Channels, Height, Width).
Input: \((Batch \times Time, Channel, Height, Width)\) or \((Batch \times Time, Channel)\)
Output: \((Batch, Time, Channel, Height, Width)\) or \((Batch, Time, Channel)\)
batch_size (int) –
Defines the computation performed at every call.
Should be overridden by all subclasses.
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.