Emit a 2D float32 initialiser after converting to row-major order.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name | |||
| real(kind=real32), | intent(in) | :: | data_col_major(:) | |||
| integer, | intent(in) | :: | rows | |||
| integer, | intent(in) | :: | cols | |||
| type(onnx_initialiser_type), | intent(inout) | :: | inits(:) | |||
| integer, | intent(inout) | :: | num_inits |
subroutine emit_matrix_initialiser(name, data_col_major, rows, cols, inits, & num_inits) !! Emit a 2D float32 initialiser after converting to row-major order. implicit none character(*), intent(in) :: name real(real32), intent(in) :: data_col_major(:) integer, intent(in) :: rows, cols type(onnx_initialiser_type), intent(inout) :: inits(:) integer, intent(inout) :: num_inits real(real32), allocatable :: row_major(:) allocate(row_major(size(data_col_major))) call col_to_row_major_2d(data_col_major, row_major, rows, cols) call emit_float_initialiser(name, row_major, [rows, cols], inits, & num_inits) deallocate(row_major) end subroutine emit_matrix_initialiser