I want to define a custom layer as the last layer of a neural network, and use a custom loss function. The problem is, that the custom layer needs the target label in order to compute it’s forward and backward functions, but only the loss function has access to the target label, I was wondering what is the standard way of implementing this.