MCPcopy Create free account
hub / github.com/OpenGVLab/EfficientQAT / clamp_ste

Function clamp_ste

quantize/quantizer.py:16–17  ·  view source on GitHub ↗
(x: torch.Tensor, min, max)

Source from the content-addressed store, hash-verified

14 return (x.round() - x).detach() + x
15
16def clamp_ste(x: torch.Tensor, min, max):
17 return (x.clamp(min,max) - x).detach() + x
18
19def clamp_ste(x: torch.Tensor, min, max):
20 return (x.clamp(min,max) - x).detach() + x

Callers 1

fake_quantMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected