If you write your custom Function, you can have it do whatever you want. But the batching is not done automatically. It will be called with the Tensor that you give it. So you need to write your Function to work with batches.