MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / norm_cdf

Function norm_cdf

python/oneflow/nn/init.py:258–260  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

256def trunc_normal_(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0):
257 # Method based on https://people.sc.fsu.edu/~jburkardt/presentations/truncated_normal.pdf
258 def norm_cdf(x):
259 # Computes standard normal cumulative distribution function
260 return (1.0 + math.erf(x / math.sqrt(2.0))) / 2.0
261
262 if (mean < a - 2 * std) or (mean > b + 2 * std):
263 warnings.warn(

Callers 1

trunc_normal_Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected