possibly fixed concurrency issues in learning order of templates, made parser faster by using non-growable tensor at test time