I’m like 80% sure it should be differentaible. What makes you feel it would not be?
By the way, one of the nice things about tf is, I’ve tried some really convoluted bizarre cost functions, and they’ve all been differentabiel. It’s quite nice…