TorchScript compatibility?
See original GitHub issueHi all,
This library looks very nice 😃
Is TensorType
compatible with the TorchScript compiler? As in, are the annotations transparently converted to torch.Tensor
as far as torch.jit.script
is concerned, allowing annotated modules/functions to be compiled? (I’m not worried about whether the type checking applied in TorchScript, just whether an annotated program that gets shape-checked in Python can be compiled down to TorchScript.)
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:7 (3 by maintainers)
Top Results From Across the Web
TorchScript — PyTorch 1.13 documentation
TorchScript is a way to create serializable and optimizable models from PyTorch code. Any TorchScript program can be saved from a Python process...
Read more >Torch Script — PyTorch master documentation - API Manual
In our examples, we use comment-based annotations to ensure Python 2 compatibility as well. Expressions¶. The following Python Expressions are supported.
Read more >TorchScript JIT Support - Lightning Flash - Read the Docs
Task torch.jit.script() torch.jit.trace() torch.jit.save()
ImageClassifier Yes Yes Yes
ObjectDetector Yes No Yes
ImageEmbedder Yes Yes Yes
Read more >TorchScript for Deployment — PyTorch Tutorials 1.8.1+cu102 ...
All of the pretrained models in TorchVision are compatible with TorchScript. Run the following Python 3 code, either in a script or from...
Read more >How to Run Inference on Ludwig Models Using TorchScript
In order to support this, we needed to ensure that everything from preprocessing to postprocessing was TorchScript-compatible in order to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found another way to deal with torchscript. Just paste the code and call
patch_torchscript()
before exporting.Not that I know about. As far as I know this is still a limitation in torchscript itself.
If this is a priority for you then you might like to try bringing this up with the torchscript team. They might know more about any possibilities for making this work.