Apply 2-D average pooling with a k×k window and stride s (default 1). Windows that do not fit entirely inside the input are not used. Pass s=k for the usual non-overlapping pooling.
Implement solve(X,k,s=1).
Returns. Return a float array of shape ((H - k)//s + 1, (W - k)//s + 1); if the window is larger than the input the result is empty.
Example 1
Input:
solve([[1, 3], [2, 4]], 2)
Output:
[[2.5]]
Example 2
Input:
solve([[1, 2, 5, 6], [3, 4, 7, 8], [9, 1, 2, 3], [4, 5, 6, 7]], 2, 2)
Output:
[[2.5, 6.5], [4.75, 4.5]]
No results yet
Run your code to check it against the examples, or submit to run every test.