# How parametric Relu implemented internally

**URL:** <https://discuss.pytorch.org/t/how-parametric-relu-implemented-internally/51421>\
**Category:** Uncategorized\
**Created:** [July 23, 2019, 6:19pm UTC](https://discuss.pytorch.org/t/how-parametric-relu-implemented-internally/51421 "2019-07-23T18:19:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhakshiin](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/dhakshiin/32/12956_2.png) [@dhakshiin](https://discuss.pytorch.org/u/dhakshiin)\
**Post date:** [July 23, 2019, 6:19pm UTC](https://discuss.pytorch.org/t/how-parametric-relu-implemented-internally/51421/1 "2019-07-23T18:19:17Z")

</div>

i am trying to multiply the input vector of size (4,5,32,32)  
here  
4 - batch size  
5 - channels  
32 x 32 feature size

As mentioned in the parametric channelwise relu i want to multiply a vector to each of the channels

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [July 23, 2019, 10:06pm UTC](https://discuss.pytorch.org/t/how-parametric-relu-implemented-internally/51421/2 "2019-07-23T22:06:51Z")

</div>

Please don’t tag certain people specifically. They will answer, if they have time.  
Also, this might discourage other users to post an answer.

---

<div class="post-metadata">

**Author:** ![dhakshiin](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/dhakshiin/32/12956_2.png) [@dhakshiin](https://discuss.pytorch.org/u/dhakshiin)\
**Post date:** [July 29, 2019, 3:25am UTC](https://discuss.pytorch.org/t/how-parametric-relu-implemented-internally/51421/3 "2019-07-29T03:25:28Z")

</div>

Sure. Can u pls provide suggestion for my question

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [August 11, 2019, 9:37pm UTC](https://discuss.pytorch.org/t/how-parametric-relu-implemented-internally/51421/4 "2019-08-11T21:37:56Z")

</div>

Could you explain the parametric channelwise ReLU?  
How would you like to multiply the input of `[4, 5, 32, 32]` with a tensor, i.e. what shape would the internal tensor have?

---

<div class="post-metadata">

**Author:** ![dhakshiin](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/dhakshiin/32/12956_2.png) [@dhakshiin](https://discuss.pytorch.org/u/dhakshiin)\
**Post date:** [August 18, 2019, 11:04am UTC](https://discuss.pytorch.org/t/how-parametric-relu-implemented-internally/51421/5 "2019-08-18T11:04:42Z")

</div>

The internal tensor will be of 1x channel number. For 5 channel input we would have 1x5 as the internal tensor.

For [4 , 5, 32, 32]  
We need to multiply 1 value for each of the [32,32] in each batch.  
So 5 different values are used for each of the 5 channels in 32 x 32
