← 返回 waymo 的题目列表Implement Max Pooling with Argmax Coordinates
类型:qbank
Implement max pooling over an input tensor. The follow-up requires returning the coordinates of each selected maximum together with the pooled values.
Requirements
Implement max pooling over an input tensor or matrix.
Produce the maximum value for each pooling window.
Follow-up: return the coordinate of each maximum together with its value.
Clarify the window shape, stride, padding behavior, tensor layout, and tie-breaking rule for equal maxima before implementation.
Notes
Treat output-shape calculation and boundary handling as part of the contract; write them down before the nested loops.
The coordinate follow-up requires a deterministic tie rule when a window contains the same maximum more than once.
Keep value selection and coordinate tracking in one pass so the two outputs cannot diverge.
Preparation
Implement 2-D max pooling from scratch for both non-overlapping and overlapping windows.
Add coordinate output and test ties, partial boundary windows, negative-only inputs, and different stride values.
Practice translating between common channel-first and channel-last tensor layouts without changing the pooling semantics.