Calculate input shape based on shapes of input layers
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(add_layer_type), | intent(in) | :: | this |
Instance of the layer |
||
| integer, | intent(in), | dimension(:,:) | :: | input_shapes |
Input shapes |
Calculated input shape
function calc_input_shape_add(this, input_shapes) result(input_shape) !! Calculate input shape based on shapes of input layers implicit none ! Arguments class(add_layer_type), intent(in) :: this !! Instance of the layer integer, dimension(:,:), intent(in) :: input_shapes !! Input shapes integer, allocatable, dimension(:) :: input_shape !! Calculated input shape ! Local variables integer :: i ! Check that all input shapes are the same do i = 2, size(input_shapes, 2), 1 if(any(input_shapes(:,1).ne.input_shapes(:,i)))then call stop_program("All input shapes to add layer must be the same") return end if end do ! Set input shape input_shape = input_shapes(:,1) end function calc_input_shape_add