Skip to content

KeyError: key Symbol not found #312

@SkyWorld117

Description

@SkyWorld117

I did an update of LV from 0.12.50 to 0.12.59. The following code ran well on 0.12.50 but triggers KeyError on 0.12.59 and 0.12.60.

@avxt for i in axes(nn.voltage, 1)
    s = 0.0f0
    for j in axes(nn.weights, 2)
        s += nn.weights[i,j] * nn.output[j,t]
        nn.weights[i,j] += ifelse(i!=j, min(A₋*nn.M[i]*nn.weights[i,j], 1.0f0), 0.0f0) * ifelse(nn.output[j,t]!=0, 1.0f0, 0.0f0)
        nn.weights[i,j] = ifelse(nn.weights[i,j]>θ*Cₘ+gₗ*-Eₗ), θ*Cₘ+gₗ*-Eₗ), nn.weights[i,j])
        nn.weights[i,j] = ifelse(nn.weights[i,j]<-θ*Cₘ-gₗ*-Eₗ), -θ*Cₘ-gₗ*-Eₗ), nn.weights[i,j])
    end
    nn.voltage[i,1] += 1/Cₘ * (s - gₗ*(nn.voltage[i,1] - Eₗ))
    nn.voltage[i,1] = ifelse(nn.voltage[i,1]>θ, θ, nn.voltage[i,1])
    nn.voltage[i,1] = ifelse(nn.voltage[i,1]<Eₗ, Eₗ, nn.voltage[i,1])
end

However, if I deactivate some lines in the block, it can pass the compiling.

@avxt for i in axes(nn.voltage, 1)
    s = 0.0f0
    for j in axes(nn.weights, 2)
        s += nn.weights[i,j] * nn.output[j,t]
        nn.weights[i,j] += ifelse(i!=j, min(A₋*nn.M[i]*nn.weights[i,j], 1.0f0), 0.0f0) * ifelse(nn.output[j,t]!=0, 1.0f0, 0.0f0)
        #nn.weights[i,j] = ifelse(nn.weights[i,j]>θ*Cₘ+gₗ*(θ-Eₗ), θ*Cₘ+gₗ*(θ-Eₗ), nn.weights[i,j])
        #nn.weights[i,j] = ifelse(nn.weights[i,j]<-θ*Cₘ-gₗ*(θ-Eₗ), -θ*Cₘ-gₗ*(θ-Eₗ), nn.weights[i,j])
    end
    nn.voltage[i,1] += 1/Cₘ * (s - gₗ*(nn.voltage[i,1] - Eₗ))
    #nn.voltage[i,1] = ifelse(nn.voltage[i,1]>θ, θ, nn.voltage[i,1])
    #nn.voltage[i,1] = ifelse(nn.voltage[i,1]<Eₗ, Eₗ, nn.voltage[i,1])
end

I could not develop a simpler case because they work somehow fine with the similar principal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions