<p dir="auto">Right now StorageImpl records a dtype. We should remove the dtype and store bytes directly. Non-POD dtypes should still support custom destruction, but that is built on top of an otherwise untyped representation. Representing storage impls in an untyped way means that we can reinterpret cast tensors, e.g., view a float tensor as a complex tensor.</p>
<p dir="auto">In the user side we still expose ByteStorage/LongStorage; these should either be eliminated from Python, or implemented as wrappers that know dtype.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ezyang/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ezyang">@ezyang</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gchanan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gchanan">@gchanan</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zou3519/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zou3519">@zou3519</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/anjali411/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/anjali411">@anjali411</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dylanbespalko/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dylanbespalko">@dylanbespalko</a></p>
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">I'm able to create a torch.Tensor from a list of numpy arrays, but I'm not able to create torch.Tensor from a list of torch.Tensors, raising:</p>
<p dir="auto"><code class="notranslate">ValueError: only one element tensors can be converted to Python scalars</code></p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<p dir="auto">This code raises above error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="tensors_list = [torch.Tensor(1,3), torch.Tensor(1,3)]
list_to_tensor = torch.Tensor(tensors_list)"><pre class="notranslate"><code class="notranslate">tensors_list = [torch.Tensor(1,3), torch.Tensor(1,3)]
list_to_tensor = torch.Tensor(tensors_list)
</code></pre></div>
<p dir="auto">While this code works fine:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="np_list = [np.random.rand(1,3), np.random.rand(1,3)]
list_to_tensor = torch.Tensor(np_list)"><pre class="notranslate"><code class="notranslate">np_list = [np.random.rand(1,3), np.random.rand(1,3)]
list_to_tensor = torch.Tensor(np_list)
</code></pre></div>
<h2 dir="auto">Environment</h2>
<p dir="auto">PyTorch version: 1.5.0<br>
Is debug build: No<br>
CUDA used to build PyTorch: 10.2</p>
<p dir="auto">OS: Ubuntu 20.04 LTS<br>
GCC version: (Ubuntu 9.3.0-10ubuntu2) 9.3.0<br>
CMake version: Could not collect</p>
<p dir="auto">Python version: 3.8<br>
Is CUDA available: Yes<br>
CUDA runtime version: Could not collect<br>
GPU models and configuration: GPU 0: GeForce MX150<br>
Nvidia driver version: 440.82<br>
cuDNN version: Could not collect</p>
<p dir="auto">Versions of relevant libraries:<br>
[pip3] numpy==1.18.4<br>
[pip3] torch==1.5.0<br>
[pip3] torchtext==0.6.0<br>
[pip3] torchvision==0.6.0<br>
[conda] Could not collect</p>
<h2 dir="auto">Additional context</h2>
<p dir="auto">This is probably very minor bug, not sure if I should've posted it here, but I'm too much of a beginner to judge so here it is.</p>