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

Function tensor_grad_scale

codegeex/mindspore/src/pangu_alpha_wrapcell.py:72–73  ·  view source on GitHub ↗
(scale, grad)

Source from the content-addressed store, hash-verified

70
71@grad_scale.register("Tensor", "Tensor")
72def tensor_grad_scale(scale, grad):
73 return grad * P.Cast()(reciprocal(scale), F.dtype(grad))
74
75
76@grad_scale.register("Tensor", "Tensor", "Tensor")

Callers

nothing calls this directly

Calls 1

dtypeMethod · 0.80

Tested by

no test coverage detected