Get partial derivative of softmax reverse operation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(inout) | :: | this | |||
| type(array_type), | intent(in) | :: | upstream_grad |
function get_partial_softmax_reverse_right(this, upstream_grad) result(output) !! Get partial derivative of softmax reverse operation implicit none class(array_type), intent(inout) :: this type(array_type), intent(in) :: upstream_grad type(array_type) :: output type(array_type), pointer :: ptr ptr => ( & upstream_grad - & sum(this%left_operand * upstream_grad, dim=this%indices(1)) & ) * this%left_operand call output%assign_and_deallocate_source(ptr) end function get_partial_softmax_reverse_right