Freezing specific parameters in a layer

Hey!

I am new to Julia and I’ve been playing around with Flux library. What I am trying to do now is to freeze specific weights that I want. I found a function that is supposed to do that: delete!(params, model), but with it I can only freeze all the weights for a layer, but can’t get it to work for specific weigths. So I decided to look into the source code of delete!() and try to understand how everything works and I think that I understand the general idea. However there is a problem that I have and I can’t seem to understand why it works that way

So at first I define my model

m = Chain(
Dense(10, 5, relu),
Dense(5, 2))

and get the weigths for the first layer.

ps = Flux.params(m[1].W)

But when I do an if statement of

if m[1].W in ps.params

it returns true, while when I do an if statement of

if m[1].W[1:5, 1:10] in ps.params

I get false. I can’t seem to understand why it works that way since both are arrays that have the same elements and same dimensions. Thanks in advance !