Repository navigation
Commit d632341
authored
Fix DS-CNN Cortex-M input memory format (pytorch#21485)
### Summary
The shared DS-CNN model wrapper returned a contiguous NCHW example
input, while the Cortex-M backend requires channels-last inputs. This
caused the nightly Cortex-M FVP run to abort in
`cortex_m::quantized_depthwise_conv2d.out` with `input must be
channels_last`.
Convert the example input to channels-last, matching the existing
Cortex-M DS-CNN tests and backend contract. The tensor values and eager
model output are unchanged.
### Test plan
Ran `python -m py_compile examples/models/mlperf_tiny/ds_cnn.py` and
`git diff --check`. Loaded the patched wrapper and verified input stride
`(490, 1, 10, 1)`, eager output shape `(1, 12)`, and the exported
user-input stride `(490, 1, 10, 1)`.
Authored with Claude.1 parent 4e285f4 commit d632341
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments