Hi!
The best solution, as usual, is just to check it in practice (whether it works or not) 
But as I understand mechanics, after loss calculation you will get a scalar value that will be backpropagated. And I suppose it shouldn’t care about the difference of input and output batch sizes.