You can’t easily batch trees with this approach. You would need to use something like SPINN https://github.com/jekbradbury/examples/tree/spinn/snli/spinn.py 75 (or in general batch before compute-heavy ops and unbatch after)