Gradient of duvenaud_update with respect to packed weights.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(inout) | :: | this |
Forward result node containing saved operands |
||
| type(array_type), | intent(in) | :: | upstream_grad |
Upstream gradient tensor |
Gradient tensor for left operand (weights)
function get_partial_duvenaud_update_weight(this, upstream_grad) result(output) !! Gradient of duvenaud_update with respect to packed weights. 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 left operand (weights) ! Local variables logical :: right_is_temporary_local !! Saved temporary-ownership flag for right operand type(array_type), pointer :: ptr !! Intermediate gradient tensor pointer right_is_temporary_local = this%right_operand%is_temporary this%right_operand%is_temporary = .false. ptr => duvenaud_update( this%right_operand, upstream_grad, & this%indices, this%left_operand%indices(1), this%left_operand%indices(2) ) this%right_operand%is_temporary = right_is_temporary_local call output%assign_and_deallocate_source(ptr) end function get_partial_duvenaud_update_weight