@@ -33,6 +33,7 @@ module nf_network
33
33
procedure , private :: forward_1d_int
34
34
procedure , private :: forward_2d
35
35
procedure , private :: forward_3d
36
+ procedure , private :: get_output_1d
36
37
procedure , private :: predict_1d
37
38
procedure , private :: predict_1d_int
38
39
procedure , private :: predict_2d
@@ -42,6 +43,7 @@ module nf_network
42
43
43
44
generic :: evaluate = > evaluate_batch_1d
44
45
generic :: forward = > forward_1d, forward_1d_int, forward_2d, forward_3d
46
+ generic :: get_output = > get_output_1d
45
47
generic :: predict = > predict_1d, predict_1d_int, predict_2d, predict_3d
46
48
generic :: predict_batch = > predict_batch_1d, predict_batch_3d
47
49
@@ -131,7 +133,7 @@ end subroutine forward_3d
131
133
132
134
end interface forward
133
135
134
- interface output
136
+ interface predict
135
137
136
138
module function predict_1d (self , input ) result(res)
137
139
! ! Return the output of the network given the input 1-d array.
@@ -169,9 +171,10 @@ module function predict_3d(self, input) result(res)
169
171
real , allocatable :: res(:)
170
172
! ! Output of the network
171
173
end function predict_3d
172
- end interface output
173
174
174
- interface output_batch
175
+ end interface predict
176
+
177
+ interface predict_batch
175
178
module function predict_batch_1d (self , input ) result(res)
176
179
! ! Return the output of the network given an input batch of 3-d data.
177
180
class(network), intent (in out ) :: self
@@ -191,7 +194,14 @@ module function predict_batch_3d(self, input) result(res)
191
194
real , allocatable :: res(:,:)
192
195
! ! Output of the network; the last dimension is the batch
193
196
end function predict_batch_3d
194
- end interface output_batch
197
+ end interface predict_batch
198
+
199
+ interface get_output
200
+ module subroutine get_output_1d (self , output )
201
+ class(network), intent (in ), target :: self
202
+ real , pointer , intent (out ) :: output(:)
203
+ end subroutine get_output_1d
204
+ end interface get_output
195
205
196
206
interface
197
207
0 commit comments