Why AsStridedBackward0 appear here? And Under what circumstances does it occur?

haoran-hash: <p>I want to understand autograd graph, so I write a code snippet about <code>+=</code>.</p>
<pre data-code-wrap="python"><code class="lang-python">import torch
from collections import deque


a = torch.tensor([1, 2, 3], dtype=torch.float32, requires_grad=True)
b = torch.tensor([4, 5, 6], dtype=torch.float32)
b[0] += a[0]
print(b)


# look autograd graph
graph = [[(b.grad_fn,)]]
queue = deque([b.grad_fn])
while len(queue) != 0:
    item = queue.popleft()
    if item is None:
        continue
    if type(item).__name__ == 'AccumulateGrad':
        continue
    temp = []
    for fn, _ in item.next_functions:
        queue.append(fn)
        if type(fn).__name__ == 'AccumulateGrad':
            temp.append((fn, fn.variable))
        else:
            temp.append((fn,))
    graph.append(temp)

for x in graph:
    print(x)
</code></pre>
<p><code>print</code> result is below.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/3/3/3393eb0946f6129be061e5762c72107898eab286.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/3393eb0946f6129be061e5762c72107898eab286" title="屏幕截图 2022-05-28 092403"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/3/3/3393eb0946f6129be061e5762c72107898eab286_2_690x163.jpeg" alt="屏幕截图 2022-05-28 092403" data-base62-sha1="7mhgn8hYCdCDypeiAzbfLUPC3tQ" width="690" height="163" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/3/3/3393eb0946f6129be061e5762c72107898eab286_2_690x163.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/3/3/3393eb0946f6129be061e5762c72107898eab286_2_1035x244.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/3/3/3393eb0946f6129be061e5762c72107898eab286.jpeg 2x" data-dominant-color="E8EAE9"><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">屏幕截图 2022-05-28 092403</span><span class="informations">1053×249 103 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>
In order to see clearly, I visualize it.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/8/a8d1a0e0ef91a3a51bd9c2236e16627d9bc85135.png" data-download-href="https://discuss.pytorch.org/uploads/default/a8d1a0e0ef91a3a51bd9c2236e16627d9bc85135" title="未命名文件"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/a/8/a8d1a0e0ef91a3a51bd9c2236e16627d9bc85135_2_690x369.png" alt="未命名文件" data-base62-sha1="o5rlcbCra0w430Cd8TEhShX7SRL" width="690" height="369" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/a/8/a8d1a0e0ef91a3a51bd9c2236e16627d9bc85135_2_690x369.png, https://discuss.pytorch.org/uploads/default/optimized/3X/a/8/a8d1a0e0ef91a3a51bd9c2236e16627d9bc85135_2_1035x553.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/a/8/a8d1a0e0ef91a3a51bd9c2236e16627d9bc85135_2_1380x738.png 2x" data-dominant-color="ADCFAD"><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">未命名文件</span><span class="informations">2066×1106 144 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>
What puzzles me is why there is <code>AsStridedBackward0</code> and so many <code>CopySlices</code>.<br>
I hope someone can help me. Thanks a lot.</p>