get_partial_duvenaud_propagate_right Function

function get_partial_duvenaud_propagate_right(this, upstream_grad) result(output)

Gradient of duvenaud_propagate with respect to edge_features.

Arguments

Type IntentOptional Attributes Name
class(array_type), intent(inout) :: this

Forward result node containing saved operands

type(array_type), intent(in) :: upstream_grad

Upstream gradient tensor

Return Value type(array_type)

Gradient tensor for right operand


Source Code

  function get_partial_duvenaud_propagate_right(this, upstream_grad) result(output)
    !! Gradient of duvenaud_propagate with respect to edge_features.
    implicit none

    ! Arguments
    class(array_type), intent(inout) :: this
    !! Forward result node containing saved operands
    type(array_type), intent(in) :: upstream_grad
    !! Upstream gradient tensor
    type(array_type) :: output
    !! Gradient tensor for right operand

    ! Local variables
    logical :: left_is_temporary_local
    !! Saved temporary-ownership flag for left operand
    type(array_type), pointer :: ptr
    !! Intermediate gradient tensor pointer

    left_is_temporary_local = this%left_operand%is_temporary
    this%left_operand%is_temporary = .false.
    ptr => duvenaud_propagate( this%left_operand, upstream_grad, &
         this%indices, this%adj_ja )
    this%left_operand%is_temporary = left_is_temporary_local
    call output%assign_and_deallocate_source(ptr)

  end function get_partial_duvenaud_propagate_right