Abstract class for representing TensorFlow exceptions.
Keeps a map from unique tokens (i.e., integer IDs) to Scala functions (i.e., callbacks), each of which takes an array with handles of tensors as input and returns an array with handles of tensors as output.