Forward propagation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dropblock3d_layer_type), | intent(inout) | :: | this |
Instance of the 3D dropblock layer |
||
| class(array_type), | intent(in), | dimension(:,:) | :: | input |
Input values |
subroutine forward_dropblock3d(this, input) !! Forward propagation implicit none ! Arguments class(dropblock3d_layer_type), intent(inout) :: this !! Instance of the 3D dropblock layer class(array_type), dimension(:,:), intent(in) :: input !! Input values ! Local variables real(real32) :: rtmp1 !! Temporary variable type(array_type), pointer :: ptr !! Pointer array rtmp1 = 1._real32 - this%rate select case(this%inference) case(.true.) ! Do not perform the drop operation ptr => input(1,1) * rtmp1 case default ! Perform the drop operation rtmp1 = 1._real32 / rtmp1 ptr => merge_over_channels( & input(1,1), 0._real32, & reshape(this%mask, shape = [product(shape(this%mask)), 1]) & ) * rtmp1 end select call this%output(1,1)%assign_and_deallocate_source(ptr) this%output(1,1)%is_temporary = .false. end subroutine forward_dropblock3d