# Running a vocoder in C++

**URL:** <https://discuss.pytorch.org/t/running-a-vocoder-in-c/124565>\
**Category:** C++\
**Created:** [June 20, 2021, 2:21pm UTC](https://discuss.pytorch.org/t/running-a-vocoder-in-c/124565 "2021-06-20T14:21:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pak123](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/p/9f8e36/32.png) [@pak123](https://discuss.pytorch.org/u/pak123)\
**Post date:** [June 20, 2021, 2:21pm UTC](https://discuss.pytorch.org/t/running-a-vocoder-in-c/124565/1 "2021-06-20T14:21:14Z")

</div>

Hello,  
I have a mel file which I generated using Python and saved using torch.save().  
Now i want to load this file in C++ into a torch:;Tesnsor.  
I looked at from\_blob but it does not seem to fit this scenario.  
How can I load such a file (or pickled npy?) from disk into a tensor in C++?

Thanks

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [June 21, 2021, 1:49am UTC](https://discuss.pytorch.org/t/running-a-vocoder-in-c/124565/2 "2021-06-21T01:49:15Z")

</div>

I’m not sure, if [this comment](https://github.com/pytorch/pytorch/issues/36568#issuecomment-613688287) is still up-to-date, but if so you should use `torch.jit.save` on the Python side and load it via `torch::load` in C++.
