<h2 dir="auto">🐛 Bug</h2>

<h2 dir="auto">To Reproduce</h2>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import torch
input = torch.zeros ([1,1,1])
input2 = torch.zeros ([1,4,1,1])
out= torch.zeros([1])
torch.cholesky_solve(input=input, input2=input2, out=out)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">torch</span>
<span class="pl-s1">input</span> <span class="pl-c1">=</span> <span class="pl-s1">torch</span>.<span class="pl-en">zeros</span> ([<span class="pl-c1">1</span>,<span class="pl-c1">1</span>,<span class="pl-c1">1</span>])
<span class="pl-s1">input2</span> <span class="pl-c1">=</span> <span class="pl-s1">torch</span>.<span class="pl-en">zeros</span> ([<span class="pl-c1">1</span>,<span class="pl-c1">4</span>,<span class="pl-c1">1</span>,<span class="pl-c1">1</span>])
<span class="pl-s1">out</span><span class="pl-c1">=</span> <span class="pl-s1">torch</span>.<span class="pl-en">zeros</span>([<span class="pl-c1">1</span>])
<span class="pl-s1">torch</span>.<span class="pl-en">cholesky_solve</span>(<span class="pl-s1">input</span><span class="pl-c1">=</span><span class="pl-s1">input</span>, <span class="pl-s1">input2</span><span class="pl-c1">=</span><span class="pl-s1">input2</span>, <span class="pl-s1">out</span><span class="pl-c1">=</span><span class="pl-s1">out</span>)</pre></div>
<p dir="auto">Output:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="free(): invalid pointer
Aborted (core dumped)"><pre class="notranslate"><span class="pl-en">free</span>(): <span class="pl-s1">invalid</span> <span class="pl-s1">pointer</span>
<span class="pl-v">Aborted</span> (<span class="pl-s1">core</span> <span class="pl-s1">dumped</span>)</pre></div>

<h2 dir="auto">Expected behavior</h2>
<p dir="auto">Expect no aborts</p>

<h2 dir="auto">Environment</h2>
<p dir="auto">Please copy and paste the output from our<br>
<a href="https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py" rel="nofollow">environment collection script</a><br>
(or fill out the checklist below manually).</p>
<p dir="auto">You can get the script and run it with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py"><pre class="notranslate"><code class="notranslate">wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
</code></pre></div>
<p dir="auto">PyTorch version: 1.5.0<br>
Is debug build: No<br>
CUDA used to build PyTorch: 10.1</p>
<p dir="auto">OS: Ubuntu 18.04.4 LTS<br>
GCC version: Could not collect<br>
CMake version: version 3.14.0</p>
<p dir="auto">Python version: 3.7<br>
Is CUDA available: No<br>
CUDA runtime version: No CUDA<br>
GPU models and configuration: No CUDA<br>
Nvidia driver version: No CUDA<br>
cuDNN version: No CUDA</p>
<p dir="auto">Versions of relevant libraries:<br>
[pip] numpy==1.18.1<br>
[pip] torch==1.5.0<br>
[pip] torchvision==0.6.0a0+82fd1c8<br>
[conda] blas 1.0 mkl<br>
[conda] cudatoolkit 10.1.243 h6bb024c_0<br>
[conda] mkl 2020.1 217<br>
[conda] mkl-include 2020.1 217<br>
[conda] mkl-service 2.3.0 py37he904b0f_0<br>
[conda] mkl_fft 1.0.15 py37ha843d7b_0<br>
[conda] mkl_random 1.1.0 py37hd6b4f25_0<br>
[conda] numpy 1.18.1 py37h4f9e942_0<br>
[conda] numpy-base 1.18.1 py37hde5b4d6_1<br>
[conda] pytorch 1.5.0 py3.7_cuda10.1.243_cudnn7.6.3_0 pytorch<br>
[conda] torchvision 0.6.0 py37_cu101 pytorch</p>
<h2 dir="auto">Additional context</h2>

<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></p>
<p dir="auto">Duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="472938990" data-permission-text="Title is private" data-url="https://github.com/pytorch/vision/issues/1172" data-hovercard-type="issue" data-hovercard-url="/pytorch/vision/issues/1172/hovercard" href="https://github.com/pytorch/vision/issues/1172">pytorch/vision#1172</a>, but in main torch repo so we can keep all milestone issues together.</p>