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

Function softmax_backward_lower

imperative/python/megengine/xla/rules/nn.py:739–743  ·  view source on GitHub ↗
(ctx, *args: Union[HLOTensor, Sequence[HLOTensor]])

Source from the content-addressed store, hash-verified

737
738@register_lower_rule("SoftmaxBackward")
739def softmax_backward_lower(ctx, *args: Union[HLOTensor, Sequence[HLOTensor]]):
740 assert (
741 len(args) == 2 and len(ctx.vars_in) == 2 and len(ctx.vars_out) == 1
742 ), f"{len(args)}, {len(ctx.vars_in)}, {len(ctx.vars_out)}"
743 return softmax_grad(args[0], args[1], ctx.param["axis"])

Callers

nothing calls this directly

Calls 1

softmax_gradFunction · 0.85

Tested by

no test coverage detected