Small fixes for TF
Created by: scarlehoff
These are some small fixes to TF. It fixes a few warnings but afaics they were not bugs.
The only one that made a bit of a difference (in that otherwise some tensorflow-cuda combinations fail) is adding the output shape to the boolean mask with a tf.function
decorator.
Without that, (at least the Arch builds of) tensorflow 2.16.1 with Cuda 12.4 fail since it compiles away the boolean mask but then it calls the cuda kernel with the wrong shape.