MCPcopy Create free account
hub / github.com/OpenGVLab/UniFormerV2 / round_width

Function round_width

slowfast/models/utils.py:8–21  ·  view source on GitHub ↗
(width, multiplier, min_width=1, divisor=1, verbose=False)

Source from the content-addressed store, hash-verified

6
7
8def round_width(width, multiplier, min_width=1, divisor=1, verbose=False):
9 if not multiplier:
10 return width
11 width *= multiplier
12 min_width = min_width or divisor
13 if verbose:
14 logger.info(f"min width {min_width}")
15 logger.info(f"width {width} divisor {divisor}")
16 logger.info(f"other {int(width + divisor / 2) // divisor * divisor}")
17
18 width_out = max(min_width, int(width + divisor / 2) // divisor * divisor)
19 if width_out < 0.9 * width:
20 width_out += divisor
21 return int(width_out)

Callers 3

__init__Method · 0.90
_construct_networkMethod · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected