MCPcopy Create free account
hub / github.com/DragonisCV/RAM / diff_round

Function diff_round

ram/utils/diffjpeg.py:26–29  ·  view source on GitHub ↗

Differentiable rounding function

(x)

Source from the content-addressed store, hash-verified

24
25
26def diff_round(x):
27 """ Differentiable rounding function
28 """
29 return torch.round(x) + (x - torch.round(x))**3
30
31
32def quality_to_factor(quality):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected