MCPcopy Create free account
hub / github.com/amazon-science/mm-cot / quantize_float

Function quantize_float

timm/models/regnet.py:102–104  ·  view source on GitHub ↗

Converts a float to closest non-zero int divisible by q.

(f, q)

Source from the content-addressed store, hash-verified

100
101
102def quantize_float(f, q):
103 """Converts a float to closest non-zero int divisible by q."""
104 return int(round(f / q) * q)
105
106
107def adjust_widths_groups_comp(widths, bottle_ratios, groups):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected