Reconstruct dynamic LNO poles from exported encoder/decoder arguments.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(onnx_initialiser_type), | intent(in) | :: | e_args_init | |||
| type(onnx_initialiser_type), | intent(in) | :: | d_args_init | |||
| integer, | intent(in) | :: | num_inputs | |||
| integer, | intent(in) | :: | num_outputs | |||
| real(kind=real32), | intent(out) | :: | poles(:) |
subroutine infer_dynamic_lno_poles(e_args_init, d_args_init, num_inputs, & num_outputs, poles) !! Reconstruct dynamic LNO poles from exported encoder/decoder arguments. implicit none type(onnx_initialiser_type), intent(in) :: e_args_init, d_args_init integer, intent(in) :: num_inputs, num_outputs real(real32), intent(out) :: poles(:) integer :: k, idx, num_modes real(real32) :: pi_value num_modes = size(poles) if(num_inputs .gt. 1 .and. allocated(e_args_init%data))then do k = 1, num_modes idx = (k - 1) * num_inputs + num_inputs poles(k) = -e_args_init%data(idx) end do return end if if(num_outputs .gt. 1 .and. allocated(d_args_init%data))then do k = 1, num_modes idx = (num_outputs - 1) * num_modes + k poles(k) = -d_args_init%data(idx) end do return end if pi_value = acos(-1.0_real32) do k = 1, num_modes poles(k) = real(k, real32) * pi_value end do end subroutine infer_dynamic_lno_poles