Load ONNX attributes into softmax activation function
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(softmax_actv_type), | intent(inout) | :: | this |
Softmax activation type |
||
| type(onnx_attribute_type), | intent(in), | dimension(:) | :: | attributes |
Array of ONNX attributes |
subroutine apply_attributes_softmax(this, attributes) !! Load ONNX attributes into softmax activation function implicit none ! Arguments class(softmax_actv_type), intent(inout) :: this !! Softmax activation type type(onnx_attribute_type), dimension(:), intent(in) :: attributes !! Array of ONNX attributes ! Local variables integer :: i !! Loop variable ! Load provided attributes do i=1, size(attributes,dim=1) select case(trim(attributes(i)%name)) case("scale") read(attributes(i)%val,*) this%scale if(abs(this%scale-1._real32) .gt. 1.e-6_real32)then this%apply_scaling = .true. else this%apply_scaling = .false. end if case("name") if(trim(attributes(i)%val) .ne. trim(this%name))then call print_warning( & 'Softmax activation: name attribute "' // & trim(attributes(i)%val) // & '"" does not match expected "' // trim(this%name)//'"' & ) end if case default call print_warning( & 'Softmax activation: unknown attribute '// & trim(attributes(i)%name) & ) end select end do end subroutine apply_attributes_softmax