pycuda version of final model(wip)