print('Your GPU has %s GBs of free memory' % str(freeGPUMemInGBs))
testData = shared(np.random.random((5000, 256 * 256)).astype(T.config.
    floatX), borrow=True)
print('The tasks above used %s GBs of your GPU memory. The available memory is %s GBs' % (
    str(freeGPUMemInGBs - GPUFreeMemoryInBytes / 1024.0 / 1024 / 1024), str
    (GPUFreeMemoryInBytes / 1024.0 / 1024 / 1024)))
Как рассчитать использование памяти GPU в Theano?