MCPcopy Index your code
hub / github.com/facebookresearch/SlowFast / round_width

Function round_width

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

Source from the content-addressed store, hash-verified

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

Callers 4

__init__Method · 0.90
__init__Method · 0.90
_construct_networkMethod · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected