Why I can't use torch::cat or stack to concatenate to tensor in vs?

Kelvin_Shaw: <p>I use other function in libtorch  runs correctly， but when I use cat or stack , it reports debug error, abort has been called.</p>
<pre><code class="lang-auto">	auto b = torch::ones({ 3,4 });
	auto c = torch::zeros({ 3,4 });
	auto stack = torch::stack({ b,c }, 1);
	auto cat = torch::cat({ b,c }, 1);
	cout &lt;&lt; b &lt;&lt; c &lt;&lt; cat &lt;&lt; stack;
</code></pre>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/5/3/53dc16439faa45fc9069a39ee24fe4544e3be65d.png" data-download-href="https://discuss.pytorch.org/uploads/default/53dc16439faa45fc9069a39ee24fe4544e3be65d" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/5/3/53dc16439faa45fc9069a39ee24fe4544e3be65d_2_690x287.png" alt="image" data-base62-sha1="bXRabcvJGDcGkWmuPl1bRq7Ianj" width="690" height="287" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/5/3/53dc16439faa45fc9069a39ee24fe4544e3be65d_2_690x287.png, https://discuss.pytorch.org/uploads/default/optimized/3X/5/3/53dc16439faa45fc9069a39ee24fe4544e3be65d_2_1035x430.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/5/3/53dc16439faa45fc9069a39ee24fe4544e3be65d.png 2x" data-dominant-color="232423"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1291×537 44.7 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
vs2019, libtorch cpu debug</p>

ptrblck: <p>I cannot reproduce the issue and get this output:</p>
<pre><code class="lang-auto"># main.cpp
#include &lt;torch/script.h&gt; // One-stop header.

#include &lt;iostream&gt;


int main(int argc, const char* argv[]) {
  auto b = torch::ones({ 3,4 });
  auto c = torch::zeros({ 3,4 });
  auto stack = torch::stack({ b,c }, 1);
  auto cat = torch::cat({ b,c }, 1);
  std::cout &lt;&lt; b &lt;&lt; c &lt;&lt; cat &lt;&lt; stack;

  return 0;
}
</code></pre>
<p>Output:</p>
<pre><code class="lang-auto">./example-app 
 1  1  1  1
 1  1  1  1
 1  1  1  1
[ CPUFloatType{3,4} ] 0  0  0  0
 0  0  0  0
 0  0  0  0
[ CPUFloatType{3,4} ] 1  1  1  1  0  0  0  0
 1  1  1  1  0  0  0  0
 1  1  1  1  0  0  0  0
[ CPUFloatType{3,8} ](1,.,.) = 
  1  1  1  1
  0  0  0  0

(2,.,.) = 
  1  1  1  1
  0  0  0  0

(3,.,.) = 
  1  1  1  1
  0  0  0  0
[ CPUFloatType{3,2,4} ]
</code></pre>

Kelvin_Shaw: <p>Thanks, I found this bug in version:libtorch-win-shared-with-deps-debug-1.12.1+cpu;Now I try torch::cat or stack in version:libtorch-win-shared-with-deps-debug-1.8.2+cpu, it runs well.</p>

gongdangpi: <p>1.10.1+CPU runs well also</p>

BongHoe_Koo: <p><a class="mention" href="/u/ptrblck">@ptrblck</a><br>
It doesn’t work either. Can you share where I can get the old version library?</p>

ychl87: <p>I also have this question, libtorch CPU version is OK, but CUDA version got this error</p>

blake_liu: <p>libtorch-win-shared-with-deps-1.12.1 cpu  failed!</p>

blake_liu: <p>libtorch-win-shared-with-deps-1.13.1 cpu success !</p>