Block masking in TensorFlow

This will already work also with jit_compile.

If you are interested we are tracking the nested conditional workaround in this example at:

Wrapping the __call__ with autovectorization @tf.function with “exactly” the same code in the example it will require to cover additional builtins that we are tracking in the same ticket.
Or in the meantime you will need to substitute Python builtin min with an equivalent TF op.
See also:
https://tensorflow-prod.ospodiscourse.com/t/you-cannot-build-your-model-by-calling-build-if-your-layers-do-not-support-float-type-inputs/8356/6