Compare two layers of the same model

Hello,
I’m writing a code for an AutoEncoder and testing the relevance of each layer using a function.
After calculating the relevance of each layer, how can I compare them and prune the one with the lower relevance??

Thank you