# TorchScript usability

**URL:** <https://dev-discuss.pytorch.org/t/torchscript-usability/55>\
**Category:** compiler\
**Created:** [January 23, 2021, 10:47am UTC](https://dev-discuss.pytorch.org/t/torchscript-usability/55 "2021-01-23T10:47:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom](https://yyz2.discourse-cdn.com/flex036/user_avatar/dev-discuss.pytorch.org/tom/32/26_2.png) [@tom](https://dev-discuss.pytorch.org/u/tom)\
**Post date:** [January 23, 2021, 10:47am UTC](https://dev-discuss.pytorch.org/t/torchscript-usability/55/1 "2021-01-23T10:47:01Z")

</div>

Hi,

so recently, I looked a bit into TorchScript usability and tried to collect some ideas in the [ScriptTorch blog post](https://lernapparat.de/scripttorch/).  
I see two main things that I would like to see improved:

- User experience: Easier scripting of models (e.g. by having fallbacks).

- Dev experience:  
I want to enable doing graph transformations from Python. I’m toying around with it [in a blog post](https://lernapparat.de/jit-vmap/) (note that this isn’t intended to be a serious vmap implementation, that is just an example).

I already got quite a bit of feedback on slack and in-person calls (thank you!), and I’ll try to summarize things a bit, but maybe here is a good place for additional feedback.

Given that this is quite a large program, it would be cool to get your input on both what’s missing and what how you would tackle them (in terms of prioritization and also implementation).

Best regards

Thomas

---

<div class="post-metadata">

**Author:** ![tom](https://yyz2.discourse-cdn.com/flex036/user_avatar/dev-discuss.pytorch.org/tom/32/26_2.png) [@tom](https://dev-discuss.pytorch.org/u/tom)\
**Post date:** [January 26, 2021, 7:22am UTC](https://dev-discuss.pytorch.org/t/torchscript-usability/55/2 "2021-01-26T07:22:13Z")

</div>

It’s too late to edit, but the broken link should be “I’m toying around with it [in a blog post](https://lernapparat.de/jit-python-graphops/)”. Thank you, Yanan Cao, for pointing it out!

---

<div class="post-metadata">

**Author:** ![tom](https://yyz2.discourse-cdn.com/flex036/user_avatar/dev-discuss.pytorch.org/tom/32/26_2.png) [@tom](https://dev-discuss.pytorch.org/u/tom)\
**Post date:** [January 26, 2021, 10:26am UTC](https://dev-discuss.pytorch.org/t/torchscript-usability/55/3 "2021-01-26T10:26:45Z")

</div>

As a follow-up on the general usability topic: I wrote a new blog post about a potential route to implement fallbacks to Python: [https://lernapparat.de/jit-fallback/](https://lernapparat.de/jit-fallback/)  
This only covers datatypes and functions the JIT cannot handle, not syntax constructs, but I think it might be a good way to give the user more freedom to use whatever tools they see fit (but obviously, the JIT won’t know what’s happening in them).
