akankshakshurai/cuda-error-resolution-analysis huggingface dataset:
Why the collective communication library is named as c10d?

spico197: <p>Hi there, I’m just curious why the collective communication library is called <code>c10d</code>. Is there any direct meaning related to this?</p>
<p>Thanks very much ~</p>

ptrblck: <p>I guess the idea was to use it as a common backend for PyTorch and Caffe2 (before it died) in the <code>c10(d)</code> namespace instead of <code>ATen</code>.</p>

fduwjj: <p>right and “d” here just means distributed. haha.</p>
Pytorch Probabilty Neural Network Example

pumplerod: <p>I had not been able to locate examples for how to create a neural network whose weights/bias are drawn from a probability distribution, using only the main pytorch library, without reliance on additional libraries such as <code>pyro</code>.  Thanks to the help from this community, <a class="mention" href="/u/krypticmouse">@krypticmouse</a> in particular, I was able to cobble together a working example which I’ve posted on Medium.</p>
<p>I hope others might find it useful, and welcome suggestions on how to improve what’s been published as I’m still learning best practices on this subject matter.</p>
<p>Here is a link to the article: <a href="https://medium.com/@pumplerod/probabilistic-neural-network-with-pytorch-11ec04479f67" rel="noopener nofollow ugc">Probabilistic Neural Network with Pytorch</a></p>
Access gradients before they are aggregated to the node

EduardoSlonski: <p>How can I have access to the gradients during backward before they are aggregated to the parameter in Pytorch?</p>
<p>Like when multiple inputs use the same parameter, the gradients are summed up during backward.<br>
For example in the following case how can I get the gradients of the parameters of <code>linear</code> with respect to each sequence of <code>inputs</code></p>
<pre><code class="lang-auto">loss_fn = nn.CrossEntropyLoss()

inputs = torch.tensor([[[1, 2, 3, 4],
                      [5, 6, 7, 8],
                      [9, 10, 11, 12]]]).float()

labels = torch.tensor([[3, 6, 0]])

linear = nn.Linear(4, 8)

out = linear(inputs)

loss = loss_fn(out.view(-1, out.shape[-1]), labels.view(-1))
loss.backward()
</code></pre>
<p>Just like the way I can calculate them separately here:</p>
<pre><code class="lang-auto">grads = []
for i in range(3):
    linear.zero_grad()
    loss = loss_fn(out[:, i, :].view(-1, out.shape[-1]), labels[:, i].view(-1)) / 3
    loss.backward(retain_graph=True)
    grads.append(linear.weight.grad.clone())
</code></pre>

soulitzer: <p>You might be looking for <a href="https://pytorch.org/tutorials/intermediate/per_sample_grads.html" class="inline-onebox" rel="noopener nofollow ugc">Per-sample-gradients — PyTorch Tutorials 2.1.0+cu121 documentation</a></p>
Cannot reshape tensor to desired shape

Neloy_sarwar: <p>I am creating a tensor using torch.frombuffer(). The buffer contains image data. When i am trying to reshape the tensor to (H,W,C) I am getting the following error:</p>
<p>Error in processing frame: shape ‘[640, 640, 3]’ is invalid for input of size 1310720.</p>
<p>Could this be due to stride bytes?</p>

bfc: <p>Maybe because 640 * 640 * 3 is not equal to 1310720?</p>

Neloy_sarwar: <p>I am receiving the buffer from a gstreamer pipeline. And i have reshaped the image to 640x640 inside the pipeline before creating the tensor.</p>

bfc: <p>Can you confirm the frame size from gstreamer is really 640x640? Is the size of your buffer fixed or is it guaranteed to the the exact same size as the number of bytes in a single frame? Because 1310720 bytes is more than a single frame. It might be that you are receiving extra bytes that you need to keep track of and only take 640 * 640 * 3 (1228800) if they are available. A code snippet would also help.</p>
Ccache 0 hits and all misses

100deep1001: <p>I am using ccache to speed up my build process and ensure to add ccache to PATH.<br>
However, when I print the ccache summary while building pytorch, it shows 0 hits and all misses:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/9/3/93936076bda25f9f37060846e212f04a1cc9fffd.png" data-download-href="https://discuss.pytorch.org/uploads/default/93936076bda25f9f37060846e212f04a1cc9fffd" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/9/3/93936076bda25f9f37060846e212f04a1cc9fffd.png" alt="image" data-base62-sha1="l3vWncn9Eu6Zo8fmnv3wz0CPsx7" width="690" height="274" data-dominant-color="151717"><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">707×281 13.4 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></p>
<p>Is my ccache being used at all. How do I check this?</p>
<p>Additionally, I can see that ccache is set in my CMakeCache.txt file as well:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/c/a/cadf25b9a6f479584e3be5eb8c513e1b134d4a9d.png" data-download-href="https://discuss.pytorch.org/uploads/default/cadf25b9a6f479584e3be5eb8c513e1b134d4a9d" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/c/a/cadf25b9a6f479584e3be5eb8c513e1b134d4a9d.png" alt="image" data-base62-sha1="sWGxtXPceLvruzEp0n2uaOnPyFf" width="690" height="76" data-dominant-color="F5F4E7"><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">773×86 3.28 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></p>
<p>Running <code>DEBUG=1 USE_DISTRIBUTED=0 USE_MKLDNN=0 USE_CUDA=0 BUILD_TEST=0 USE_FBGEMM=0 USE_NNPACK=0 USE_QNNPACK=0 USE_XNNPACK=0 python setup.py develop </code> is taking me more than 12 to 14 hours.</p>
<p>Any help appreciated!<br>
Thanks</p>
Is there an estimate on when pytorch 2.1.0 is out?

egesko: <p>Just as the topic says.</p>

ptrblck: <p>It should be released today.</p>

ptrblck: <p>And here it is:</p><aside class="onebox allowlistedgeneric" data-onebox-src="https://pytorch.org/blog/pytorch-2-1/">
  <header class="source">
      <img src="https://pytorch.org/favicon.ico?" class="site-icon" width="32" height="32">

      <a href="https://pytorch.org/blog/pytorch-2-1/" target="_blank" rel="noopener">pytorch.org</a>
  </header>

  <article class="onebox-body">
    <img width="500" height="500" src="https://pytorch.org/assets/images/pytorch-logo.png" class="thumbnail onebox-avatar">

<h3><a href="https://pytorch.org/blog/pytorch-2-1/" target="_blank" rel="noopener">PyTorch</a></h3>

  <p>An open source machine learning framework that accelerates the path from research prototyping to production deployment.</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
Torchaudio in C++

dagrawal: <p>Hi,<br>
I am using torchaudio in python to read wave files. However, torchaudio isn’t available in C++, so is there any alternate way to do this?</p>
<aside class="quote" data-post="1" data-topic="62400">
  <div class="title">
    <div class="quote-controls"></div>
    <img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/oktai15/48/5942_2.png" class="avatar">
    <a href="https://discuss.pytorch.org/t/torchaudio-load-in-c/62400">Torchaudio.load() in C++</a> <a class="badge-category__wrapper " href="/c/audio/9"><span data-category-id="9" data-drop-close="true" class="badge-category "><span class="badge-category__name">audio</span></span></a>
  </div>
  <blockquote>
    I want to convert ogg-file to torch.Tensor using torchaudio.load function, but in deployment I need to do it in C++ (I converted original model to TorchScript). Can I use it from C++? Or what can I do as alternative?
  </blockquote>
</aside>
<p>
The discussion topic above is for the same issue. The solution provided there point to a page (<a href="https://github.com/pytorch/audio/blob/master/torchaudio/torch_sox.cpp" rel="noopener nofollow ugc">https://github.com/pytorch/audio/blob/master/torchaudio/torch_sox.cpp</a>) that does not exist.</p>

dagrawal: <p>Hello <a class="mention" href="/u/ptrblck">@ptrblck</a>, can you help me with this please?</p>

ptrblck: <p>I guess the current approach would be to use <code>torchaudio::sox::load_audio_file</code> from <a href="https://github.com/pytorch/audio/blob/bf77b2a032b4b7ce0e0c03ab6c66881cc83c62c9/torchaudio/csrc/sox/io.cpp#L58"><code>torchaudio/csrs/sox/io.cpp</code></a>.</p>

dagrawal: <p>Thank you, I will try it out!</p>

moto: <p>Please use <code>torchaudio::io::StreamReader</code>.</p>
<p><a href="https://pytorch.org/audio/main/libtorchaudio.stream_reader.html" class="onebox" target="_blank" rel="noopener nofollow ugc">https://pytorch.org/audio/main/libtorchaudio.stream_reader.html</a></p>

dagrawal: <p>Thank you, I will check it out.</p>
Want to make a backward pass that is the autograd of a different function

Cpuguy: <p>Hi, I want to create a custom layer that has a backward pass that isn’t the gradient of it’s forward pass, but is instead a pytorch autograd of a different forward pass. In addition, I want the layer to have saved variables. I’m wondering if there is an example of a good way to do this.</p>
<p>The only way I can think to do this is to make an nn.module extension that stores the saved variables, have this call an extension of the autograd.funcion class, and have this autograd function perform a backward pass by performing a forward pass and then autograd of another non.module extension. Which doesn’t seem very elegant.</p>

soulitzer: <p>Not sure if there’s a better way to do this unfortunately.</p>
How to set up MASTER_PORT and MASTER_ADDR in slurm

ximing: <p>In torch’s official documentation that talks about DDP, it said to set it as the following:</p>
<pre><code class="lang-auto">def setup(rank, world_size):
    os.environ['MASTER_ADDR'] = 'localhost'
    os.environ['MASTER_PORT'] = '12355'
</code></pre>
<p>and now I am using slurm to submit sbatch jobs, in this tutorial provided by Princeton University:</p><aside class="onebox githubfolder" data-onebox-src="https://github.com/PrincetonUniversity/multi_gpu_training/tree/main/02_pytorch_ddp">
  <header class="source">
      <img src="https://github.githubassets.com/favicons/favicon.svg" class="site-icon" width="32" height="32">

      <a href="https://github.com/PrincetonUniversity/multi_gpu_training/tree/main/02_pytorch_ddp" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>

  <article class="onebox-body">
    <h3><a href="https://github.com/PrincetonUniversity/multi_gpu_training/tree/main/02_pytorch_ddp" target="_blank" rel="noopener nofollow ugc">multi_gpu_training/02_pytorch_ddp at main ·...</a></h3>

  <p><a href="https://github.com/PrincetonUniversity/multi_gpu_training/tree/main/02_pytorch_ddp" target="_blank" rel="noopener nofollow ugc">main/02_pytorch_ddp</a></p>

  <p><span class="label1">Contribute to PrincetonUniversity/multi_gpu_training development by creating an account on GitHub.</span></p>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
<p>
it has the following setup:</p>
<pre><code class="lang-auto">export MASTER_PORT=$(expr 10000 + $(echo -n $SLURM_JOBID | tail -c 4))
master_addr=$(scontrol show hostnames "$SLURM_JOB_NODELIST" | head -n 1)
export MASTER_ADDR=$master_addr
echo "MASTER_ADDR="$MASTER_ADDR
</code></pre>
<p>But it seems even if I just keep the master_addr to localhost and master_port to 12355, and then submit it to slurm, it can still run.</p>
<p>Can anyone explain it a little bit more? For example, where does “12355” comes from , can it be random?</p>
<p>Thanks!</p>

Jamie_Donnelly: <p>My understanding is that it just needs to be a free port and so you can just use a random large digit number since it’s unlikely to be duplicated;</p>
<p><code>export MASTER_PORT=$(expr 10000 + $(echo -n $SLURM_JOBID | tail -c 4))</code></p>
<p>just ensures that you’ll generate a (most probably) new port number for each number job.</p>

maxim.yudayev: <p>In your case it works because you are running it on a single node. If you ran on multiple nodes, <code>"localhost"</code> would resolve to the IP of each node separately and they would not know about each other’s existence since the job script, once launched by SLURM, executes the same job script for each of the allocated nodes. Once SLURM launched the job from the queue, <code>SLURM_JOB_NODELIST</code> contains IPs of nodes that were allocated to the job; piping its content to <code>head -n 1</code> simply gives the IP of the first allocated node in the list and sets it as master.</p>
<p>Port number can be set random and will be okay unless you are unlucky and some other process or SLURM user uses that random port number.</p>
Hello everyone how to modify a image recognition CNN model to train video data?

Teddy_Salas: <p>Hello everyone i have a CNN model with me using to  train and recognise images , i wanted  change that CNN model to train videos, can any one help?</p>
<p>here is the code:-</p>
<p>class tinyvgg1(nn.Module):<br>
def <strong>init</strong>(self,hidden,input,output):<br>
super().<strong>init</strong>()<br>
self.Conv_block1 = nn.Sequential(<br>
nn.Conv2d(<br>
in_channels= input,<br>
out_channels=hidden,<br>
kernel_size=3,<br>
stride=1,<br>
padding=1<br>
),<br>
nn.BatchNorm2d(hidden),<br>
nn.ReLU(),<br>
nn.Dropout(0.2),<br>
nn.Conv2d(<br>
in_channels = hidden,<br>
out_channels =hidden,<br>
kernel_size=3,<br>
stride=1,<br>
padding=1<br>
),<br>
nn.BatchNorm2d(hidden),<br>
nn.ReLU(),<br>
nn.MaxPool2d(kernel_size=2,stride=2)<br>
)<br>
self.Conv_block2 = nn.Sequential(<br>
nn.Conv2d(<br>
in_channels=hidden,<br>
out_channels=hidden,<br>
kernel_size=3,<br>
stride=1,<br>
padding=1<br>
),<br>
nn.BatchNorm2d(hidden),<br>
nn.ReLU(),<br>
nn.Dropout(0.2),<br>
nn.Conv2d(<br>
in_channels=hidden,<br>
out_channels=hidden,<br>
kernel_size=3,<br>
stride=1,<br>
padding=1<br>
),</p>
<pre><code>    nn.BatchNorm2d(hidden),
    nn.ReLU(),
    nn.MaxPool2d(kernel_size=2,stride=2)
)
self.Conv_block3 = nn.Sequential(
    nn.Conv2d(
        in_channels=hidden,
        out_channels=hidden,
        kernel_size=3,
        stride=1,
        padding=1
    ),
    nn.BatchNorm2d(hidden),
    nn.ReLU(),
    nn.Dropout(0.2),
    nn.Conv2d(
        in_channels=hidden,
        out_channels=hidden,
        kernel_size=3,
        stride=1,
        padding=1
    ),
    nn.BatchNorm2d(hidden),
    nn.ReLU(),
    nn.MaxPool2d(kernel_size=2,stride=2)
)
self.Conv_block4 = nn.Sequential(
    nn.Conv2d(
        in_channels=hidden,
        out_channels=hidden,
        kernel_size=3,
        stride=1,
        padding=1
    ),
    nn.BatchNorm2d(hidden),
    nn.ReLU(),
    nn.Dropout(0.2),
    nn.Conv2d(
        in_channels=hidden,
        out_channels=hidden,
        kernel_size=3,
        stride=1,
        padding=1
    ),
    nn.BatchNorm2d(hidden),
    nn.ReLU(),
    nn.MaxPool2d(kernel_size=2,stride=2)
)

self.classifier = nn.Sequential(
    nn.Flatten(),
    nn.Linear(
        in_features = hidden*14*14,
        out_features = output
    )
)
</code></pre>
<p>def forward(self,x):<br>
x = self.Conv_block1(x)<br>
<span class="hashtag-raw">#print</span>(x.shape)<br>
x = self.Conv_block2(x)<br>
<span class="hashtag-raw">#print</span>(x.shape)<br>
x = self.Conv_block3(x)<br>
<span class="hashtag-raw">#print</span>(x.shape)<br>
x = self.Conv_block4(x)<br>
<span class="hashtag-raw">#print</span>(x.shape)<br>
x = self.classifier(x)<br>
return x<br>
return self.Conv_block4(self.Conv_block3(self.Conv_block2(self.Conv_block1(x))))</p>
How to implement Stateful LSTM

saj: <pre><code class="lang-auto">class StatefulLSTM(nn.Module):
    def init(self, num_features, hidden_size=100, hidden_size_lstm=100, num_layers_lstm=3, dropout_lstm=0, batch_size=128):
    super(StatefulLSTM, self).init()
    # Parameters
    self.num_features = num_features
    self.hidden_size = hidden_size
    self.hidden_size_lstm = hidden_size_lstm
    self.num_layers_lstm = num_layers_lstm
    self.batch_size = batch_size
# Representation learning part
    self.lstm = nn.LSTM(num_features, hidden_size_lstm, num_layers_lstm, batch_first=True, dropout=dropout_lstm)

    # Representation to hidden
    self.fc1 = nn.Linear(hidden_size_lstm, hidden_size)
    self.relu = nn.ReLU()

    # Hidden to output
    self.fc2 = nn.Linear(hidden_size, 1)
    self.sigmoid = nn.Sigmoid()

    # Initialize hidden and cell states
    self.hidden = self.init_hidden()

def init_hidden(self):
    # Initialize hidden and cell states with zeros
    h0 = torch.zeros(self.num_layers_lstm, self.batch_size, self.hidden_size_lstm).to(device)
    c0 = torch.zeros(self.num_layers_lstm, self.batch_size, self.hidden_size_lstm).to(device)
    return (h0, c0)

def forward(self, x):

    representation, self.hidden = self.lstm(x.transpose(1, 2), self.hidden.detach())

    hidden_state = self.hidden[0][-1]
    out = self.fc1(hidden_state)
    out = self.relu(out)

    out = self.fc2(out)
    out = self.sigmoid(out)

    return out
</code></pre>
<p>I am new to pytorch and experimenting with Stateful. I want to check how hidden state output flows from one batch to another batch. how can the code above be converted into stateful?</p>
DataParallel with qml.qnn.TorchLayer: AttributeError: _buffers

Meintrok: <p>I’m new with DATAPARALLEL and I’m trying to figure out how it works. I have 2 GPUs and I’m creating a quatum circuit with qml.qnn.TorchLayer and I’ve created the net like this:</p>
<p>model = torch.nn.DataParallel(model, device_ids=device_ids)<br>
model.to(f’cuda:{model.device_ids[0]}')</p>
<p>But when I do model(X) the next error ocurs: AttributeError: _buffers<br>
Anyone have an idea of what could be happening?</p>
<p>Thanks</p>
Question regarding the behaviour of key_padding_mask in nn.MultiheadAttention for self attention

rajeshTU: <p>While doing self attention at the encoder layer I get the following attention_weights as my output.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/1/9/1950bb20f981fa288e10c936d12622ecaeac19ea.png" data-download-href="https://discuss.pytorch.org/uploads/default/1950bb20f981fa288e10c936d12622ecaeac19ea" title="Figure_1_last"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/1/9/1950bb20f981fa288e10c936d12622ecaeac19ea_2_666x500.png" alt="Figure_1_last" data-base62-sha1="3BWTVyJy5CUSRf04f8Kewb3Bqwq" width="666" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/1/9/1950bb20f981fa288e10c936d12622ecaeac19ea_2_666x500.png, https://discuss.pytorch.org/uploads/default/original/3X/1/9/1950bb20f981fa288e10c936d12622ecaeac19ea.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/1/9/1950bb20f981fa288e10c936d12622ecaeac19ea.png 2x" data-dominant-color="93769B"><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">Figure_1_last</span><span class="informations">800×600 18.8 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></p>
<p>Its clear that key_padding_mask masks the attention where the padding’s are given but why it’s only in one axis, I was expecting the heat map to have zeroes for the masked regions in the y direction as well. can you help me solve this.</p>
<p>this is how my key_padding_mask looks like<br>
<code>tensor([[False, False,  True,  True,  True,  True,  True,  True,  True,  True,          False,  True,  True,  True,  True,  True,  True,  True,  True,  True,          False,  True,  True,  True,  True,  True,  True,  True,  True,  True,           True,  True,  True,  True,  True,  True,  True,  True,  True,  True,           True,  True,  True,  True,  True,  True,  True,  True,  True,  True]],        device='cuda:0') </code><br>
<span data-date="2023-10-04" class="discourse-local-date" data-timezone="Europe/Berlin" data-email-preview="2023-10-03T22:00:00Z UTC">2023-10-03T22:00:00Z</span></p>
Warping images using disparity maps for stereo matching

Sarthak_Vora: <p>I am trying to warp an image using a disparity map. The original image size is (375, 1242) and same is the size for disparity map. Both, the image and disparity map, are grayscale images. Below is the code I tried to execute</p>
<pre><code class="lang-auto">import numpy as np
import torch
import torch.nn.functional as F

# Load the image (img) to be warped using PIL library
# Load the disparity map image (disp) using PIL library

disp = np.array(disp, dtype=np.float32) / 256.

x = np.array(img)
img = torch.Tensor(x)
img.resize_(1,3,375,1242)
batch_size,_,height, width = img.size()

# Original coordinates of pixels
x_base = torch.linspace(0, 1, width).repeat(batch_size, height, 1).type_as(img)
y_base = torch.linspace(0, 1, height).repeat(batch_size, width, 1).transpose(1, 2).type_as(img)

disp = torch.Tensor(disp)
disp.resize_(1,375,1242)

flow_field = torch.stack((x_base + disp, y_base), dim=3)

# In grid_sample coordinates are assumed to be between -1 and 1
output = F.grid_sample(img, 2*flow_field - 1, mode='bilinear', padding_mode='zeros')
</code></pre>
<p>The image is resized to (1, 3, 375, 1242) where 1 indicates the batch_size (since only one image is to be passed) and 3 indicates the number of channels.<br>
The code is taken and modified from this source - <a href="https://github.com/OniroAI/MonoDepth-PyTorch/blob/0b7d60bd1dab0e8b6a7a1bab9c0eb68ebda51c5c/loss.py#L40" class="inline-onebox" rel="noopener nofollow ugc">MonoDepth-PyTorch/loss.py at 0b7d60bd1dab0e8b6a7a1bab9c0eb68ebda51c5c · OniroAI/MonoDepth-PyTorch · GitHub</a></p>
<p>However, I dont quite understand the working of flow_field variable and grid_sample() function.<br>
The output image, after converting the ‘output’ variable from a tensor to PIL supported dataframe, is completely black i.e all the values of the output tensor turn out to be 0.</p>
<p>Can someone help in rectifying the above code ?</p>

shenshanf: <p>flow field is the indices of target tensor element from source tensor. for example, if <code>flow_field[0,1,:]=[2, 3]</code>, it means the tensor <code>output[0,1]=img[2,3]</code>, if the indices is not integer, this function will use interpolation to get the value, the interpolation mode you can set by the function input param <code>mode</code>, if the indices is out of  source boundary, it will pad value according you set by the input param <code>padding_mode</code>.</p>
Unable to transform numpy array to tensor

wr73064: <p>When I use torch.tensor to transform a numpy array into a tensor using Spyder or VS code, I receive error message:" storage_module &amp;&amp; PyModule_Check(storage_module) INTERNAL ASSERT FAILED at “C:\cb\pytorch_1000000000000\work\torch\csrc\DynamicTypes.cpp”:101, please report a bug to PyTorch".<br>
But If I run my code on Jupyter, there is no such error. May I inquire why this happens?</p>