This works for fully connected layers only, but it works.
Contrary to layerdata, this describes the layer itself rather than the layer contents.