# Skip layer with masked weights in Flux

**URL:** <https://discourse.julialang.org/t/skip-layer-with-masked-weights-in-flux/38419>\
**Category:** General Usage\
**Created:** [April 29, 2020, 12:44pm UTC](https://discourse.julialang.org/t/skip-layer-with-masked-weights-in-flux/38419 "2020-04-29T12:44:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeepQ](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@DeepQ](https://discourse.julialang.org/u/DeepQ)\
**Post date:** [April 29, 2020, 12:44pm UTC](https://discourse.julialang.org/t/skip-layer-with-masked-weights-in-flux/38419/1 "2020-04-29T12:44:51Z")

</div>

I know that I could define an skip layer in Flux, like below:

```julia
struct Skip
      inner
end

(m::Skip) = x .+ m.inner(x)

```

But how could I multiply m.inner(x) by an sparse weight mask? How could I define the layer?
