| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(inout) | :: | this | |||
| type(array_type), | intent(in) | :: | upstream_grad |
function get_partial_sum_all(this, upstream_grad) result(output) implicit none class(array_type), intent(inout) :: this type(array_type), intent(in) :: upstream_grad type(array_type) :: output type(array_type), pointer :: ptr if(this%is_forward)then ptr => sum( upstream_grad ) else ptr => spread( & upstream_grad, & dim=1, & index=1, & ncopies= size(this%left_operand%val, 1) & ) ptr => spread( & ptr, & dim=2, & index=1, & ncopies= size(this%left_operand%val, 2) & ) end if call output%assign_and_deallocate_source(ptr) end function get_partial_sum_all