MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / _safelog

Function _safelog

imperative/python/megengine/functional/loss.py:329–331  ·  view source on GitHub ↗
(x: Tensor)

Source from the content-addressed store, hash-verified

327
328
329def _safelog(x: Tensor) -> Tensor:
330 eps = np.finfo(x.dtype).tiny
331 return log(maximum(x, eps))
332
333
334def ctc_loss(

Callers 1

ctc_lossFunction · 0.85

Calls 2

maximumFunction · 0.85
logFunction · 0.70

Tested by

no test coverage detected