Class ov::pass::StridedSliceReshapeConcatFusion#
-
class StridedSliceReshapeConcatFusion : public ov::pass::MatcherPass#
Detects and fuses framing-like subgraphs made of Slice/StridedSlice + Reshape + Concat.
This matcher pass identifies branches that extract windows from the same 2D input tensor, reshapes each window from [B, W] to [B, 1, W], and concatenates them along axis=1. The pass replaces the whole pattern with a single Gather.
Before (for illustration purpose)
StridedSlice/Slice StridedSlice/Slice … [B, W] [B, W] | | Reshape [B,1,W] Reshape [B,1,W] | | +—-— Concat(axis=1) —-—+ | Output [B, K, W]Input [B, N] | +---------------+---------------+ | | |
After
NotesInput [B, N] | Gather(axis=1, indices[K,W]) | Output [B, K, W]
All branches must read from the same source tensor.
Branch window sizes must be equal (same W).
This pass covers both Slice and StridedSlice forms under supported constraints.