Get the attributes of a convolutional layer (for ONNX export)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conv_layer_type), | intent(in) | :: | this |
Instance of the layer |
Attributes of the layer
module function get_attributes_conv(this) result(attributes) !! Get the attributes of a convolutional layer (for ONNX export) implicit none ! Arguments class(conv_layer_type), intent(in) :: this !! Instance of the layer type(onnx_attribute_type), allocatable, dimension(:) :: attributes !! Attributes of the layer ! Local variables character(256) :: buffer, fmt !! Buffer for formatting ! Allocate attributes array allocate(attributes(3)) attributes(1)%name = "kernel_shape" write(fmt,'("(",I0,"(1X,I0))")') size(this%knl) write(buffer,fmt) this%knl attributes(1)%val = trim(adjustl(buffer)) attributes(1)%type = "ints" attributes(2)%name = "strides" write(fmt,'("(",I0,"(1X,I0))")') size(this%stp) write(buffer,fmt) this%stp attributes(2)%val = trim(adjustl(buffer)) attributes(2)%type = "ints" attributes(3)%name = "dilations" write(fmt,'("(",I0,"(1X,I0))")') size(this%dil) write(buffer,fmt) this%dil attributes(3)%val = trim(adjustl(buffer)) attributes(3)%type = "ints" end function get_attributes_conv