MCPcopy Create free account
hub / github.com/Standard-Intelligence/hertz-dev / round_ste

Function round_ste

ioblocks.py:127–130  ·  view source on GitHub ↗

Round with straight through gradients.

(z: Tensor)

Source from the content-addressed store, hash-verified

125# tensor helpers
126
127def round_ste(z: Tensor) -> Tensor:
128 """Round with straight through gradients."""
129 zhat = z.round()
130 return z + (zhat - z).detach()
131
132# main class
133# lucidrains fsq

Callers 1

quantizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected