PyTorch autocomplete (code completion) in Sublime Text 3

Viewed 1344

I'm a fan of Sublime Text 3 and would like to get code autocompletion for PyTorch. However, I can't get this working yet. Any suggestions or starting points where I can begin to get this working?

I have searched in the packages repository of Sublime Text but unfortunately there's none.

Note: I have looked at a related question here IDE autocomplete for pytorch but that's only for VS Code.

1 Answers

Not a sublime user, but Jedi autocompletion handles PyTorch suggestions just fine.

Jedi is an autocompletion engine and should work for any Python package, including the ones in virtual environment if you set it up and including PyTorch/Tensorflow.

Anyway, sublime version seems to be missing a few things like results caching, hence you may have to wait a few seconds after issuing torch. (library is quite heavy, that's why you most probably will experience some lag). If you'd like to speed it up, I see no other possibility than changing it manually (vim plugin for jedi I am using has this option implemented, you may check how they've done it here, both jedi plugins seem to be written in Python hence should be tunable/fixable).

Oh, and if something isn't working (or maybe you would like to submit a PR request to jedi team/sublime jedi team), the community around it is quite vibrant and you should get some help (definitely better and more in-depth than here on StackOverflow).

Related