axon icon indicating copy to clipboard operation
axon copied to clipboard

Unwrap containers by default in Axon custom layers

Open seanmor5 opened this issue 3 years ago • 0 comments
trafficstars

We should consider unwrapping containers by default in Axon custom layers. So for example if you have a custom layer:

  defn custom_layer(foo, bar, _opts) do
    {foo, bar}
  end

You can just pattern match on the output and get regular Axon structs:

  {foo_axon, bar_axon} = Axon.layer(&custom_layer/3, [foo, bar])

seanmor5 avatar Jun 25 '22 12:06 seanmor5