Skip to content

Reshape

Bases: BaseModule

Reshape spatial [C, H, W] to flat [N, K] detection output.

In PyTorch forward: permutes NCHW → NHWC then reshapes. In compiler HWC layout this is a pure metadata change (no-op in C code).

Parameters:

Name Type Description Default
target_shape tuple[int, ...]

Output shape without batch dim, e.g. (1296, 5) for SSD stride-8 with 18x18 spatial, 4 anchors, 5 channels.

required