Skip to main content

pytorch tree lstm package

Project description


This repository contains a Pytorch Implementation of "Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks " (

This contains two type of tree-lstm (Child sum, N-ary). This was tested by Python 3.6, Pytorch 1.3.0., and this internally uses dgl 0.4.0

This repository referenced


pip install tree-lstm

after installed, you can use this via

import TreeLSTM, Tree, BatchedTree


  1. make Tree object (initialize with arbitrary tensor)
  2. make BatchedTree object using list of Tree object
  3. make TreeLSTM object (inherited from torch.nn.Module)
  4. pass BatchedTree object into TreeLSTM object

For more detailed usage, please see

Thanks for reporting issues / contributions / starts / watches!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tree-lstm, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size tree_lstm-0.0.8-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size tree_lstm-0.0.8.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page