d(out)/d(input): upstream * scale (broadcast scale along samples)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in) | :: | this |
Forward result node containing saved operands |
||
| real(kind=real32), | intent(in), | dimension(:,:) | :: | upstream_grad |
Upstream gradient values |
|
| real(kind=real32), | intent(out), | dimension(:,:) | :: | output |
Output gradient values for input |
pure subroutine get_partial_elem_scale_input_val(this, upstream_grad, output) !! d(out)/d(input): upstream * scale (broadcast scale along samples) implicit none ! Arguments class(array_type), intent(in) :: this !! Forward result node containing saved operands real(real32), dimension(:,:), intent(in) :: upstream_grad !! Upstream gradient values real(real32), dimension(:,:), intent(out) :: output !! Output gradient values for input ! Local variables integer :: i, s !! Feature and sample indices do concurrent(s = 1:size(output,2), i = 1:size(output,1)) output(i, s) = upstream_grad(i, s) * this%right_operand%val(i, 1) end do end subroutine get_partial_elem_scale_input_val