zero_all_fixed_pointer_grads Subroutine

recursive subroutine zero_all_fixed_pointer_grads(this)

Zero the gradients of all fixed-pointer nodes in the graph

Arguments

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

Source Code

  recursive subroutine zero_all_fixed_pointer_grads(this)
    !! Zero the gradients of all fixed-pointer nodes in the graph
    implicit none
    type(array_type), intent(inout) :: this

    ! Use visit_tag for O(1) cycle detection
    integer, save :: local_visit_id = 0

    diffstruc__visit_counter = diffstruc__visit_counter + 1
    local_visit_id = diffstruc__visit_counter
    call zero_fixed_grads_inner(this, local_visit_id)
  end subroutine zero_all_fixed_pointer_grads