MCPcopy Create free account
hub / github.com/ImprintLab/Medical-SAM2 / norm_range

Function norm_range

func_2d/utils.py:118–122  ·  view source on GitHub ↗
(t, value_range)

Source from the content-addressed store, hash-verified

116 img.sub_(low).div_(max(high - low, 1e-5))
117
118 def norm_range(t, value_range):
119 if value_range is not None:
120 norm_ip(t, value_range[0], value_range[1])
121 else:
122 norm_ip(t, float(t.min()), float(t.max()))
123
124 if scale_each is True:
125 for t in tensor: # loop over mini-batch dimension

Callers 1

make_gridFunction · 0.85

Calls 1

norm_ipFunction · 0.85

Tested by

no test coverage detected