How to write a sequence-to-trees LSTMs in pytorch?

I am currently working on deep semantic parsing for conversational systems. I am planning to use TOP dataset for semantic parsing. I was wondering if there are any open-sourced implementations of tree LSTMs with both top-down and bottom-up approaches. How to support batching with tree-based decoding (top-down)?

Thank you!