Natural logarithm function for autodiff arrays
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in), | target | :: | a |
module function log_array(a) result(c) !! Natural logarithm function for autodiff arrays implicit none class(array_type), intent(in), target :: a type(array_type), pointer :: c c => a%create_result() c%val = log(a%val) c%get_partial_left => get_partial_log c%get_partial_left_val => get_partial_log_val if(a%requires_grad)then c%requires_grad = .true. c%is_forward = a%is_forward c%operation = 'log' c%left_operand => a c%owns_left_operand = a%is_temporary end if end function log_array