Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions keras/src/backend/common/backend_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import functools
import math
import operator
import re
import warnings
Expand Down Expand Up @@ -539,3 +540,10 @@ def slice_along_axis(x, start=0, stop=None, step=1, axis=0):
-1 - axis
)
return x[tuple(slices)]


def compute_adaptive_pooling_window_sizes(input_dim, output_dim):
"""Compute small and big window sizes for adaptive pooling."""
small = math.ceil(input_dim / output_dim)
big = small + 1
return small, big
Loading
Loading