Demonstration of how to generate mini-batches from a constant loaded into GPU memory in Tensorflow. This code is written for Python 3. See https://eklitzke.org/pinning-gpu-memory-in-tensorflow for the full blog post.
This code is released unencumbered to the public domain; see the LICENSE file for details.