Implement 2D convolution using NumPy slicing
NVIDIASoftware Engineer · Technical ScreenLast updated
This question evaluates a candidate's proficiency with array manipulation and vectorized numerical computation using NumPy, focusing on 2D convolution concepts such as slicing, broadcasting, and filter application.
Implement 2D convolution on a 4×4 input and a 3×3 filter with stride 1 using NumPy. Avoid explicit Python loops by relying on array slicing, broadcasting, or vectorization. Return the resulting 2×2 output array.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.