hughperkins / pytorch

Python wrappers for torch and lua
BSD 2-Clause "Simplified" License
431 stars 70 forks source link

import class from arbitrary torch package #31

Open gexarcha opened 7 years ago

gexarcha commented 7 years ago

Can I import an arbitrary lua package and use one of its classes in python? I have been trying to load the file from the installation directory directly but it doesn't seem to load any of the methods of the class.

myclass =PyTorchHelpers.load_lua_class('/home/user/torch/install/share/lua/5.1/mypackage/init.lua','myclass')

Any help would be appreciated here.