What version of Julia are you using? I can’t run your function on Julia 1.5.0:

ulia> using Yota
julia> f(x) = sum(exp.(x), getindex(x, [1 3; 4 2]))
f (generic function with 1 method)
julia> s = rand(2,2)
2×2 Array{Float64,2}:
0.235071 0.271145
0.994342 0.97109
julia> f(x) = sum(exp.(x), getindex(x, [1 3; 4 2]))
f (generic function with 1 method)
julia> f(s)
ERROR: MethodError: objects of type Array{Float64,2} are not callable
Use square brackets [] for indexing an Array

Most likely this issue is not related to getindex(), but to sum(). I guess you try to use this method of sum():

Ok, with Julia 1.5.0 and Yota 0.4.4 I see another error related to the recent changes in getindex():

ERROR: BoundsError: attempt to access 1×2×2 Array{Float64,3} at index [1:1, 4, 1]

The changes were needed to support the case with repeating indices, e.g. getindex(x, [1, 2, 1]) (see related issue in Zygote if you’re curious about the whole story), but implementation is bit of a hack, so we get what we get.

I see 2 options for you here:

If you don’t plan to use repeating indices, just use Yota@0.4.2 - I just checked your f2() and f3() on it and they work perfectly fine.

If your code may have repeating indices, you will have to wait for this PR in NNlib, which I will then use to replace my hacky implementation of scatter operations.