There are several libraries that allow you to interact with the torch in python, but I would recommend lutorpy , here are some details:
lutorpy : the most promising deep learning torch based on lupa, easier to use (more pythonic). It supports the lua engine in python, all lua variables and functions are automatically converted to python objects. Thus, you can import any torch module using the "require" function. You can easily convert almost any lua / torch code to python with minimal change. It also provides conversion functions for the numpy array and torch tensor, n conversion is instantaneous as they share the base memory.
psycho python: minimal library for using lua in python, but functions are limited
lupa : A library for using lua in python with many useful features, but for lua in general, not for the torch, for example, you cannot easily convert the torch tensor to a numpy array.
pytorch: wrapper for the torch, the code is taken from the torch and compiled into a python module, so you can use the torch pythonicly, but the module you can use is very limited (so far only nn is supported).
Here is one example: fooobar.com/questions/996692 / ...
source share