MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / l2

Function l2

diffusers/examples/controlnet/train_controlnet_flax.py:981–982  ·  view source on GitHub ↗
(xs)

Source from the content-addressed store, hash-verified

979 metrics = jax.lax.pmean(metrics, axis_name="batch")
980
981 def l2(xs):
982 return jnp.sqrt(sum([jnp.vdot(x, x) for x in jax.tree_util.tree_leaves(xs)]))
983
984 metrics["l2_grads"] = l2(jax.tree_util.tree_leaves(grad))
985

Callers 1

train_stepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected