Skip to content
Deep learning with dynamic computation graphs in TensorFlow
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
abseil-cpp @ 1a9ba5e Add abseil dependency. Oct 13, 2017
tensorflow @ 8a0ac6c
tensorflow_fold Minor sync. No change in functionality. Oct 31, 2017
tools initial commit Jan 20, 2017
.gitmodules Add abseil dependency. Oct 13, 2017 initial commit Jan 20, 2017
LICENSE initial commit Jan 20, 2017 point paper links to arxiv Feb 10, 2017
WORKSPACE Update tensorflow to version 1.4. Oct 24, 2017

TensorFlow Fold

TensorFlow Fold is a library for creating TensorFlow models that consume structured data, where the structure of the computation graph depends on the structure of the input data. For example, this model implements TreeLSTMs for sentiment analysis on parse trees of arbitrary shape/size/depth.

Fold implements dynamic batching. Batches of arbitrarily shaped computation graphs are transformed to produce a static computation graph. This graph has the same structure regardless of what input it receives, and can be executed efficiently by TensorFlow.


This animation shows a recursive neural network run with dynamic batching. Operations of the same type appearing at the same depth in the computation graph (indicated by color in the animiation) are batched together regardless of whether or not they appear in the same parse tree. The Embed operation converts words to vector representations. The fully connected (FC) operation combines word vectors to form vector representations of phrases. The output of the network is a vector representation of an entire sentence. Although only a single parse tree of a sentence is shown, the same network can run, and batch together operations, over multiple parse trees of arbitrary shapes and sizes. The TensorFlow concat, while_loop, and gather ops are created once, prior to variable initialization, by Loom, the low-level API for TensorFlow Fold.

If you'd like to contribute to TensorFlow Fold, please review the contribution guidelines.

TensorFlow Fold is not an official Google product.

You can’t perform that action at this time.