get_partial_sum_all_val_sum Subroutine

pure subroutine get_partial_sum_all_val_sum(this, upstream_grad, output)

Fused partial+sum for sum_all: output(:,1) = upstream_grad(1,1)*num_samples

Arguments

Type IntentOptional Attributes Name
class(array_type), intent(in) :: this
real(kind=real32), intent(in), dimension(:,:) :: upstream_grad
real(kind=real32), intent(out), dimension(:) :: output

Source Code

  pure subroutine get_partial_sum_all_val_sum(this, upstream_grad, output)
    !! Fused partial+sum for sum_all: output(:,1) = upstream_grad(1,1)*num_samples
    implicit none
    class(array_type), intent(in) :: this
    real(real32), dimension(:,:), intent(in) :: upstream_grad
    real(real32), dimension(:), intent(out) :: output

    output(:) = upstream_grad(1,1) * real(size(upstream_grad, 2), real32)
  end subroutine get_partial_sum_all_val_sum