File: submodule_39b.f90

package info (click to toggle)
lfortran 0.61.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 61,892 kB
  • sloc: cpp: 181,767; f90: 92,175; python: 17,616; ansic: 10,170; yacc: 2,377; sh: 1,444; fortran: 892; makefile: 38; javascript: 15
file content (25 lines) | stat: -rw-r--r-- 701 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module input_output_pair_m
  implicit none

  type input_output_pair_t(k)
    integer, kind :: k = kind(1.0)
    real(k) :: input
  end type input_output_pair_t
end module input_output_pair_m

module mini_batch_m
  use input_output_pair_m, only : input_output_pair_t
  implicit none

  type mini_batch_t(k)
    integer, kind :: k = kind(1.0)
    type(input_output_pair_t(k)), allocatable :: input_output_pairs(:)
  end type mini_batch_t

  interface
    pure module function make_batch(input_output_pairs) result(mini_batch)
      type(input_output_pair_t), intent(in) :: input_output_pairs(:)
      type(mini_batch_t) :: mini_batch
    end function make_batch
  end interface
end module mini_batch_m