Function that checks how many times inputs are included, and from which layer. Used in summary function.
Useful links