MCPcopy Create free account
hub / github.com/tensorpack/tensorpack / _quantize

Function _quantize

examples/DoReFa-Net/dorefa.py:16–17  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

14
15 @tf.custom_gradient
16 def _quantize(x):
17 return tf.round(x * n) / n, lambda dy: dy
18
19 return _quantize(x)
20

Callers 1

quantizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…