How to add an ABS layer to network?

I want to add an ABS layer in my network, like this
image
In tensorflow, I can use this method:
image
How can i do that in pytorch? Thank you for your help!!

I forgot explain that ABS means absolute value… Sorry

If z_conv is the output from the previous layer, can’t you just use z_conv = z_conv.abs() ?

1 Like