@@ -44,8 +44,6 @@ pure module subroutine backward_1d(self, previous, gradient)
4444 call this_layer % backward(prev_layer % output, gradient)
4545 type is (conv2d_layer)
4646 call this_layer % backward(prev_layer % output, gradient)
47- type is (locally_connected_1d_layer)
48- call this_layer % backward(prev_layer % output, gradient)
4947 type is (maxpool2d_layer)
5048 call this_layer % backward(prev_layer % output, gradient)
5149 end select
@@ -54,7 +52,6 @@ pure module subroutine backward_1d(self, previous, gradient)
5452
5553 end subroutine backward_1d
5654
57-
5855 pure module subroutine backward_3d(self, previous, gradient)
5956 implicit none
6057 class(layer), intent (in out ) :: self
@@ -75,8 +72,6 @@ pure module subroutine backward_3d(self, previous, gradient)
7572 call this_layer % backward(prev_layer % output, gradient)
7673 type is (conv2d_layer)
7774 call this_layer % backward(prev_layer % output, gradient)
78- type is (locally_connected_1d_layer)
79- call this_layer % backward(prev_layer % output, gradient)
8075 type is (reshape3d_layer)
8176 call this_layer % backward(prev_layer % output, gradient)
8277 end select
@@ -91,8 +86,6 @@ pure module subroutine backward_3d(self, previous, gradient)
9186 call this_layer % backward(prev_layer % output, gradient)
9287 type is (input3d_layer)
9388 call this_layer % backward(prev_layer % output, gradient)
94- type is (locally_connected_1d_layer)
95- call this_layer % backward(prev_layer % output, gradient)
9689 type is (reshape3d_layer)
9790 call this_layer % backward(prev_layer % output, gradient)
9891 end select
@@ -141,8 +134,6 @@ pure module subroutine forward(self, input)
141134 call this_layer % forward(prev_layer % output)
142135 type is (conv2d_layer)
143136 call this_layer % forward(prev_layer % output)
144- type is (locally_connected_1d_layer)
145- call this_layer % forward(prev_layer % output)
146137 type is (maxpool2d_layer)
147138 call this_layer % forward(prev_layer % output)
148139 type is (reshape3d_layer)
@@ -157,8 +148,6 @@ pure module subroutine forward(self, input)
157148 call this_layer % forward(prev_layer % output)
158149 type is (conv2d_layer)
159150 call this_layer % forward(prev_layer % output)
160- type is (locally_connected_1d_layer)
161- call this_layer % forward(prev_layer % output)
162151 type is (maxpool2d_layer)
163152 call this_layer % forward(prev_layer % output)
164153 type is (reshape3d_layer)
@@ -173,8 +162,6 @@ pure module subroutine forward(self, input)
173162 call this_layer % forward(prev_layer % output)
174163 type is (conv2d_layer)
175164 call this_layer % forward(prev_layer % output)
176- type is (locally_connected_1d_layer)
177- call this_layer % forward(prev_layer % output)
178165 type is (maxpool2d_layer)
179166 call this_layer % forward(prev_layer % output)
180167 type is (reshape3d_layer)
@@ -218,6 +205,21 @@ pure module subroutine get_output_1d(self, output)
218205
219206 end subroutine get_output_1d
220207
208+ pure module subroutine get_output_2d(self, output)
209+ implicit none
210+ class(layer), intent (in ) :: self
211+ real , allocatable , intent (out ) :: output(:,:)
212+
213+ select type (this_layer = > self % p)
214+
215+ type is (locally_connected_1d_layer)
216+ allocate (output, source= this_layer % output)
217+ class default
218+ error stop ' 2d output can only be read from a locally_connected_1d layer'
219+
220+ end select
221+
222+ end subroutine get_output_2d
221223
222224 pure module subroutine get_output_3d(self, output)
223225 implicit none
@@ -230,8 +232,6 @@ pure module subroutine get_output_3d(self, output)
230232 allocate (output, source= this_layer % output)
231233 type is (conv2d_layer)
232234 allocate (output, source= this_layer % output)
233- type is (locally_connected_1d_layer)
234- allocate (output, source= this_layer % output)
235235 type is (maxpool2d_layer)
236236 allocate (output, source= this_layer % output)
237237 type is (reshape3d_layer)
0 commit comments