MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / _get_square_sum

Function _get_square_sum

codegeex/mindspore/src/utils.py:80–83  ·  view source on GitHub ↗
(grad, value)

Source from the content-addressed store, hash-verified

78
79@get_square_sum.register("Tensor", "Number")
80def _get_square_sum(grad, value):
81 norm = P.ReduceSum(False)(F.square(grad), ()) / value
82 norm = F.expand_dims(F.cast(norm, mstype.float32), 0)
83 return norm
84
85
86apply_global_norm = C.MultitypeFuncGraph("apply_global_norm")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected