Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Commit 588b748

Browse files
author
DarrenZhang01
committed
Remove the extra 2 dimensions in the output of TF reduce_window.
1 parent d730456 commit 588b748

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tf_helpers/lax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def reduce_window(inputs, init_value, reducer, window_dimensions, strides,
311311
# input shape is already finished in apply_fun of Pooling in stax.
312312
pooling = "AVG" if reducer == np.add else "MAX"
313313
output = nn.pool(inputs, window_dimensions, pooling, strides, padding)
314-
return np.asarray(output)
314+
return np.squeeze(np.asarray(output), axis=(0, output.ndim - 1))
315315

316316

317317
# TOTO (Zhibo Zhang): Expand the test cases of general convolution and revise

0 commit comments

Comments
 (0)