onnxruntime
737d2661 - Add int8/uint8 CPU support for SpaceToDepth and int8 for DepthToSpace (#29154)

Commit
70 days ago
Add int8/uint8 CPU support for SpaceToDepth and int8 for DepthToSpace (#29154) ### Description Add CPU support for 8-bit integer tensor types to the `SpaceToDepth` and `DepthToSpace` operators: - `SpaceToDepth` (opsets 1–12 and 13): previously supported only `float`/`double`; now also accepts `uint8` and `int8`. - `DepthToSpace` (opsets 11–12 and 13): previously supported `float`/`double`/`uint8`; now also accepts `int8`. `uint8_t` and `int8_t` are routed through a **single template instantiation**. These ops only shuffle 8-bit elements around, so the signedness of the data is irrelevant — handling both in one branch avoids the binary-size cost of a second instantiation (per the guidance in #21287). `SpaceDepthOpCpuImpl` now takes raw pointers so the shared branch can feed it via `DataRaw()`/`MutableDataRaw()`. Also adds typed unit tests covering `uint8`/`int8` for `SpaceToDepth` and `int8` for `DepthToSpace`, and updates `docs/OperatorKernels.md`. ### Motivation and Context Fixes #21287. The `DepthToSpace`/`SpaceToDepth` ONNX operators support integer types, but the ORT CPU kernels did not fully implement them, which is needed for running quantized models. This completes the integer support on CPU (`SpaceToDepth` had none; `DepthToSpace` was missing `int8`). The CUDA kernels are already generic and could be extended similarly in a follow-up; this PR focuses on the CPU EP.
Author
Parents
Loading