Reading Flux code base

Dear all,

I am trying to learn how to write good and efficient Julian code and Flux seems to be a good starting point. Due to that I started to read Flux code base and immediately, under src/layers/basic.jl, a code snippet caught my eye :

struct Chain{T<:Tuple}
  Chain(xs...) = new{typeof(xs)}(xs) # new ?

Could anybody explain how exactly the new works? I do not get it because there is no new keyword in Julia as far as I know and the package did not import anything from other packagaes then how ?


You might want to read the docs about Inner Constructors.

1 Like

Thank you, now I got it .