The model is trained with the regular cross entropy loss.
When func_1 is non-differentiable, W1 is not trainable (W1 would be set manually in this case before doing the training/inference).
When func_1 is differentiable, W1 will be trainable (because then W1 would be the leaf node).