Load ONNX attributes into linear activation function
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linear_actv_type), | intent(inout) | :: | this |
Linear activation type |
||
| type(onnx_attribute_type), | intent(in), | dimension(:) | :: | attributes |
Array of ONNX attributes |
subroutine apply_attributes_linear(this, attributes) !! Load ONNX attributes into linear activation function implicit none ! Arguments class(linear_actv_type), intent(inout) :: this !! Linear 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( & 'Linear activation: name attribute "' // & trim(attributes(i)%val) // & '"" does not match expected "' // trim(this%name)//'"' & ) end if case default call print_warning( & 'Linear activation: unknown attribute '// & trim(attributes(i)%name) & ) end select end do end subroutine apply_attributes_linear