# Message to admins

**URL:** <https://discuss.pytorch.org/t/message-to-admins/48153>\
**Category:** C++\
**Created:** [June 17, 2019, 2:11pm UTC](https://discuss.pytorch.org/t/message-to-admins/48153 "2019-06-17T14:11:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dambo](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/dambo/32/29088_2.png) [@dambo](https://discuss.pytorch.org/u/dambo)\
**Post date:** [June 17, 2019, 2:11pm UTC](https://discuss.pytorch.org/t/message-to-admins/48153/1 "2019-06-17T14:11:32Z")

</div>

Hello,  
Being one of the early adopters and advocated of PyTorch, I have the strange feeling that Libtorch is, to some extent neglected. This is evident in the level of activity and chatter in the C++ sub-forum.  
I find that it is very hard to get answers to the simplest questions, such as: how to work in **batches** during **inference** / and or **training** for **ImageNet** like datasets? How to utilise **multiple** GPU’s during training and **inference** of traced modules? Where can I find an example for loading an **ImageNet** like dataset NOT Mnist? and much more.

All these are trivial in PyTorch/ Python and seem almost impossible in Libtorch.

References to my questions:

> [@"Automatic parallelization of models onto multiple GPUs"](https://discuss.pytorch.org/t/automatic-parallelization-of-models-onto-multiple-gpus/48125):
>
> Hello, I have a traced model which i use in C++. The documentation clearly states: “Automatic parallelization of models onto multiple GPUs like torch.nn.parallel.DataParallel”. However I do not see this happening on a multi-gpu device. How do i explicitly force the auto module = torch::jit::load(s\_model\_name, torch::kCUDA); module to be defined like it would be in pure PyTorch? Thanks.

> [@Batch as input to module-\>forward({inputs}).toTensor()](https://discuss.pytorch.org/t/batch-as-input-to-module-forward-inputs-totensor/48039):
>
> Hello, I am trying to work in batches while reading frames using CV2 from a video like so. I first read 8 frames, batch them into std::vector\<torch::jit::IValue\> and then run them through module-\>forward({inputs}).toTensor();. However, if the batch size is larger than 1, it crashes. I guess there is some reshaping involved to add the batch dimension I am just not sure how to do it in C++. int batch\_size =1; int b\_counter=0; std::vector\<torch::jit::IValue\> inputs; //Accumulates the…

> [@(libtorch) How to use torch::data::datasets for custom dataset?](https://discuss.pytorch.org/t/libtorch-how-to-use-torch-datasets-for-custom-dataset/34221/3):
>
> Hello, Were you able to come up with a working example that mimics that of the PyTorch-based dataset for reading images? class GenericDataset(torch.utils.data.Dataset): def \_\_init\_\_(self, labels, root\_dir, subset=False, transform=None): self.labels = labels self.root\_dir = root\_dir self.transform = transform def \_\_len\_\_(self): return len(self.labels) def \_\_getitem\_\_(self, idx): img\_name = self.labels.iloc[idx, 0] # file name fullname = join(self.root\_dir, img\_n…

Is there a formal policy that allocates more resources to PyTorch related questions rather than Libtorch? If not, what is the explanation for the lack of documentation and infrequent answers in the forums?

Many thanks,

---

<div class="post-metadata">

**Author:** ![albanD](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/alband/32/215_2.png) [@albanD](https://discuss.pytorch.org/u/albanD)\
**Post date:** [June 17, 2019, 3:44pm UTC](https://discuss.pytorch.org/t/message-to-admins/48153/2 "2019-06-17T15:44:42Z")

</div>

Hi,

I think the simple answer is that almost all people answering questions are doing it in their free time and answer mostly the questions they are comfortable with. And I don’t think any of the very active people here actually use libtorch.  
At least this is the reason why I don’t usually answer such question unless it is one of the few things i touched in libtorch.

Maybe @smth can give a higher level answer on this? But the day to day answer I’m sure is the one above.

---

<div class="post-metadata">

**Author:** ![dambo](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/dambo/32/29088_2.png) [@dambo](https://discuss.pytorch.org/u/dambo)\
**Post date:** [June 18, 2019, 7:23am UTC](https://discuss.pytorch.org/t/message-to-admins/48153/3 "2019-06-18T07:23:09Z")

</div>

Sure, this makes a lot of sense, however the severe lack of documentation and examples make it very hard to progress with projects based on C++. For instance, the lack of an example for such a basic flow, to load a batch of images using an imagenet style dataloader (or without) during inference and then processing the tensors that are returned.

BR

---

<div class="post-metadata">

**Author:** ![gchanan](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@gchanan](https://discuss.pytorch.org/u/gchanan)\
**Post date:** [June 19, 2019, 11:26pm UTC](https://discuss.pytorch.org/t/message-to-admins/48153/4 "2019-06-19T23:26:20Z")

</div>

@dambo:

Thanks for bringing up this issue. I think your characterization that LibTorch is neglected, at least in comparison to areas like the Python Frontend and TorchScript, is very fair. We certainly don’t have a policy that allocates more resources to some questions over others; as @albanD suggests, we rely on the expertise of the community and our internal developers in order to answer questions, and that naturally (but unfortunately) skews away from LibTorch currently.

Let me talk about our current investment in LibTorch / C++ API and what we plan to change. By far our largest current investment in this area is with the Variable/Tensor merge in C++ – you may have seen [https://github.com/pytorch/pytorch/pull/17072](https://github.com/pytorch/pytorch/pull/17072), for example. We decided to invest in this way because: 1) it was the largest complaint we heard about the C++ API, particularly from our internal power users, 2) it unblocks performance gains that will affect all of PyTorch (python, C++, JIT). However, this has unfortunately crowded out other investments in LibTorch/ C++, as you noted.

Our plan to remedy this is two-fold:

1. The Variable/Tensor merge project is a one-time cost, so we will be able to naturally shift attention to LibTorch / C++ more generally once it is complete (should be soon).
2. We are also ramping up more people on LibTorch / C++ internally, so we can provide better and broader coverage of issues.

Again, thanks for bringing this up, and hopefully this gives you some insight into our process and investments in this area.

---

<div class="post-metadata">

**Author:** ![mhubii](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mhubii/32/71033_2.png) [@mhubii](https://discuss.pytorch.org/u/mhubii)\
**Post date:** [June 23, 2019, 3:06pm UTC](https://discuss.pytorch.org/t/message-to-admins/48153/5 "2019-06-23T15:06:36Z")

</div>

Hi @dambo,

I just answered your second question, on how to forward batches.

Concerning your third questoin, you can find an example of a custom dataset [here](https://discuss.pytorch.org/t/libtorch-how-to-use-torch-datasets-for-custom-dataset/34221/2) and I will try to include an explanation for how to load images with OpenCV.

Cheers

Martin

---

<div class="post-metadata">

**Author:** ![Carsten\_Ditzel](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/carsten_ditzel/32/8251_2.png) [@Carsten\_Ditzel](https://discuss.pytorch.org/u/Carsten_Ditzel)\
**Post date:** [June 24, 2019, 7:39am UTC](https://discuss.pytorch.org/t/message-to-admins/48153/6 "2019-06-24T07:39:58Z")

</div>

I believe things went a little bit down hill since Peter Goldsborough went off boat…

---

<div class="post-metadata">

**Author:** ![mhubii](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mhubii/32/71033_2.png) [@mhubii](https://discuss.pytorch.org/u/mhubii)\
**Post date:** [June 24, 2019, 9:46am UTC](https://discuss.pytorch.org/t/message-to-admins/48153/7 "2019-06-24T09:46:37Z")

</div>

where did he go to @Carsten_Ditzel ?

now [here](https://github.com/mhubii/libtorch_custom_dataset.git) is a little classifier that classifies apples and bananas with a custom data loader. I will polish the readme soon so people will know how to use it.

---

<div class="post-metadata">

**Author:** ![Carsten\_Ditzel](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/carsten_ditzel/32/8251_2.png) [@Carsten\_Ditzel](https://discuss.pytorch.org/u/Carsten_Ditzel)\
**Post date:** [June 24, 2019, 2:13pm UTC](https://discuss.pytorch.org/t/message-to-admins/48153/8 "2019-06-24T14:13:51Z")

</div>

I thought he turned to other things lately? At least thats what I read on his blog

---

<div class="post-metadata">

**Author:** ![mhubii](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mhubii/32/71033_2.png) [@mhubii](https://discuss.pytorch.org/u/mhubii)\
**Post date:** [June 24, 2019, 8:24pm UTC](https://discuss.pytorch.org/t/message-to-admins/48153/9 "2019-06-24T20:24:17Z")

</div>

I honestly have no idea

---

<div class="post-metadata">

**Author:** ![tom](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/tom/32/3162_2.png) [@tom](https://discuss.pytorch.org/u/tom)\
**Post date:** [June 25, 2019, 10:29am UTC](https://discuss.pytorch.org/t/message-to-admins/48153/10 "2019-06-25T10:29:56Z")

</div>

So @goldsborough [moved to the Stream Proceccing](http://www.goldsborough.me/distributed-systems/2019/04/09/21-16-52-a_look_at_mesos/) team. And boy, I do miss his awesome hacking with virtually instant bug-fixing and feature-implementations!

But then, we can help the C++ lib a lot building on his (and the others) great conceptual work by fleshing out the details - e.g. bidirectional RNNs, anyone?  
Similarly the infrastructure for C++ docs is all there, so anyone can contribute.

I’m can’t fill in for even half a Peter but I guess I know a thing or two about [hacking on PyTorch](https://lernapparat.de/fixing-your-first-pytorch-bug/) and I’d be happy to (lightly) mentor one or two people willing to work on things. Do tag me on a issue/PR or send mail.

Best regards

Thomas

---

<div class="post-metadata">

**Author:** ![dambo](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/dambo/32/29088_2.png) [@dambo](https://discuss.pytorch.org/u/dambo)\
**Post date:** [June 27, 2019, 1:05pm UTC](https://discuss.pytorch.org/t/message-to-admins/48153/11 "2019-06-27T13:05:06Z")

</div>

Thank you so much for this.
