Tensor Comprehensions is a tool from Facebook AI Research for writing custom neural network layers. It allows non-experts to write layers that achieve good performance. It can be used with frameworks like PyTorch and Caffe2. Users define layers using a simple domain-specific language. Tensor Comprehensions then optimizes and compiles the layers for fast GPU execution.