akankshakshurai/cuda-error-resolution-analysis huggingface dataset:
Implementation of ReQuantization after QConv2D

ngr-francesco: <p>Hi,</p>
<p>I’m working with a quantized convolutional network that I want to deploy on an ARM based edge device, and I am looking to perform as many operations as possible in integer/fixed point.</p>
<p>After calculating the convolution, following the reasoning from <a href="https://arxiv.org/pdf/1712.05877" rel="noopener nofollow ugc">TFLite integer-only quantization</a><br>
(section 2.2, equations 5 and 6), I’m planning to convert the re-scaling factor M mentioned there by using the notation<br>
2^-n * M0_mant * 2^(M0_exp)<br>
This conversion will, of course, introduce a slight variation from the floating point implementation and so I expect a certain deviation from the expected output of the network.<br>
The custom hardware implementation will be taken care by my own code, but I was wondering if it’s possible to use this implementation in native PyTorch, too (on cpu for example). This would allow me to use the results obtained from the cpu implementation to validate the results obtained from my edge device.</p>
<p>I tried looking up the code for the quantized operators but I couldn’t find the code related to this step in the calculation of the convolution, maybe an oversight. In that case would you be able to point me in the right direction?</p>
F.scaled_dot_product_attention - FlashAttention-1 or -2

SaudxInu: <p>Hey,</p>
<p>I just want to know the exact backend of F.scaled_dot_product_attention.</p>
<p>I am performing some benchmarking and following this article - <a href="https://pytorch.org/tutorials/intermediate/scaled_dot_product_attention_tutorial.html" class="inline-onebox" rel="noopener nofollow ugc">(Beta) Implementing High-Performance Transformers with Scaled Dot Product Attention (SDPA) — PyTorch Tutorials 2.3.0+cu121 documentation</a></p>
<p>Code says backend of F.scaled_dot_product_attention is FlashAttention-1 but documentation (<a href="https://pytorch.org/docs/2.2/generated/torch.nn.functional.scaled_dot_product_attention.html" class="inline-onebox" rel="noopener nofollow ugc">torch.nn.functional.scaled_dot_product_attention — PyTorch 2.2 documentation</a>) says it is FlashAttention-2.</p>
Destroy a torch::jit::script::Module in C++ API

Nicolik: <p>Hello there!<br>
I am trying to destroy a <code>torch::jit::script::Module</code> with the C++ API</p>
<p>The Module is loaded in this way:</p>
<pre><code class="lang-auto">	torch::jit::script::Module moduleCNN;
	try {
		moduleCNN = torch::jit::load(modelPath, device);
	}
	catch (const c10::Error &amp; e) {
		exit(EXIT_FAILURE);
	}
	moduleCNN.eval();
</code></pre>
<p>How can I manage to successfully destroy <code>moduleCNN</code> after I have finished to use it, freeing all the memory associated (not only GPU memory, but also central memory)?</p>
<p>I have tried to make something as:</p>
<pre><code class="lang-auto">	torch::jit::script::Module *moduleCNN = new torch::jit::script::Module;
	try {
		(moduleCNN*) = torch::jit::load(modelPath, device);
	}
	catch (const c10::Error &amp; e) {
		exit(EXIT_FAILURE);
	}
	(moduleCNN*).eval();

        ...

        delete moduleCNN;
</code></pre>
<p>but it has no effect on the memory occupation.</p>

jochy_gao: <p>Hi, Nicolik!<br>
Have you already solved this problem？Can you provide some suggestions？<br>
Thanks！</p>

mamsds: <p>You may try call the following function after your model reference object goes out of scope. Seems to me that it could reclaim vram from the program.</p>
<pre><code class="lang-auto">c10::cuda::CUDACachingAllocator::emptyCache();
</code></pre>
Got empty prediction result

Maraymomin: <p>Hey guys. I am currently training a FCOS model with pytorch; yet, when I try one batch before training. I got an empty prediction as followed <code>{'boxes': tensor([], size=(0, 4)), 'scores': tensor([]), 'labels': tensor([], dtype=torch.int64)}</code><br>
I set the num_cls to my desired number, 11. And it works fine if I’m using default weights.</p>
<p>I’m grateful for any comments. thanks.</p>

ptrblck: <p>This might be expected if no valid objects are found, e.g. if the model wasn’t trained at all and uses random parameters or if random noise if feed into a segmentation model as seen for <code>MaskRCNN</code>:</p>
<pre data-code-wrap="python"><code class="lang-python">model = torchvision.models.detection.maskrcnn_resnet50_fpn(weights=torchvision.models.detection.MaskRCNN_ResNet50_FPN_Weights.DEFAULT)
model.eval()
x = [torch.rand(3, 300, 400), torch.rand(3, 500, 400)]
predictions = model(x)
print(predictions)
# [{'boxes': tensor([], size=(0, 4), grad_fn=&lt;StackBackward0&gt;), 'labels': tensor([], dtype=torch.int64), 'scores': tensor([], grad_fn=&lt;IndexBackward0&gt;), 'masks': tensor([], size=(0, 1, 300, 400))}, {'boxes': tensor([], size=(0, 4), grad_fn=&lt;StackBackward0&gt;), 'labels': tensor([], dtype=torch.int64), 'scores': tensor([], grad_fn=&lt;IndexBackward0&gt;), 'masks': tensor([], size=(0, 1, 500, 400))}]
</code></pre>

Maraymomin: <p>Hey, thanks a lot for replying!<br>
It makes sense if i hadn’t trained the model and then got empty results. But, after I trained the model with my dataset and the training seemed fine I still got empty results after evaled on val dataset.</p>
Copy cpu tensor to gpu without new gpu memory (inplace copy of CPU tensor to GPU tensor)

singleroc: <h1><a name="shotage-of-gpu-memory-1" class="anchor" href="#shotage-of-gpu-memory-1"></a>shotage of GPU memory</h1>
<p>When copy a CPU tensor to GPU,</p>
<p>eg</p>
<pre><code class="lang-auto">a = torch.ones(100000).cuda()  # 100000 * 4 bytes GPU memory required
b = torch.ones(100000).fill_(2)
a.data = b.cuda()  # 200000 * 4 bytes GPU memory required，but I only have  100000 * 4 bytes GPU memory for the program
</code></pre>
<p>New gpu buffer is allocated for <code>a.data = b.cuda()</code>.  My GPU memory is very limited. The copy would cause OOM.</p>
<p>Is there any in-place copy of cpu tensor to gpu tensor?  The buffer of <code>a</code> in above example is already there. I want <code>a </code> has value of <code>b</code> with no any additional GPU memory allocation.</p>

ptrblck: <p>Use an inplace copy: <code>a.copy_(b)</code>.:</p>
<pre data-code-wrap="python"><code class="lang-python">a = torch.randn(1024**2 * 5, device="cuda")
print(torch.cuda.memory_allocated() / 1024**2)
# 20.0
print(torch.cuda.max_memory_allocated() / 1024**2)
# 20.0
print(torch.cuda.memory_reserved() / 1024**2)
# 20.0

b = torch.randn(1024**2 * 5)
a.copy_(b)
print(torch.cuda.memory_allocated() / 1024**2)
# 20.0
print(torch.cuda.max_memory_allocated() / 1024**2)
# 20.0
print(torch.cuda.memory_reserved() / 1024**2)
# 20.0
</code></pre>

singleroc: <p>So much thanks to you <a class="mention" href="/u/ptrblck">@ptrblck</a>.<br>
I previously thought <code>b</code> should be in the same device with <code>a</code> when executing <code>a.copy_(b)</code>.  You save my day <img src="https://discuss.pytorch.org/images/emoji/apple/grinning.png?v=12" title=":grinning:" class="emoji" alt=":grinning:" loading="lazy" width="20" height="20"></p>
Why don't eigenpairs calculated through torch.linalg.eig pass the eigenpair test?

Amos_Haviv_Hason: <p>Running the following code:</p>
<pre><code class="lang-auto">import torch

torch.manual_seed(47)

m = torch.rand([8, 8])

eigvals, eigvecs = torch.linalg.eig(m)

print(m.type(torch.complex64) @ eigvecs[0] - eigvals[0] * eigvecs[0])  # Should be close to →0.
</code></pre>
<p>Results with output:</p>
<pre><code class="lang-auto">tensor([ 2.2827+0.0995j, -0.9539-0.0442j, -1.9871-0.0204j, -0.6442-0.0372j,
        -0.8338-0.0518j,  1.2168-0.0077j,  0.4924-0.5008j,  0.9643+0.4292j])
</code></pre>
<p>What is going on here? How is it that the eigenpair test fails?</p>

KFrank: <p>Hi Amos!</p>
<aside class="quote no-group" data-username="Amos_Haviv_Hason" data-post="1" data-topic="202658" data-full="true">
<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/amos_haviv_hason/48/61652_2.png" class="avatar"> Amos_Haviv_Hason:</div>
<blockquote>
<pre><code class="lang-auto">eigvals, eigvecs = torch.linalg.eig(m)

print(m.type(torch.complex64) @ eigvecs[0] - eigvals[0] * eigvecs[0])  # Should be close to →0.
</code></pre>
<p>Results with output:</p>
<pre><code class="lang-auto">tensor([ 2.2827+0.0995j, -0.9539-0.0442j, -1.9871-0.0204j, -0.6442-0.0372j,
        -0.8338-0.0518j,  1.2168-0.0077j,  0.4924-0.5008j,  0.9643+0.4292j])
</code></pre>
<p>What is going on here?</p>
</blockquote>
</aside>
<p>The individual eigenvectors are stored column-wise in you <code>eigvecs</code> tensor.</p>
<p>Consider:</p>
<pre><code class="lang-plaintext">&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.__version__
'2.3.0'
&gt;&gt;&gt; _ = torch.manual_seed (47)
&gt;&gt;&gt; m = torch.rand ([8, 8])
&gt;&gt;&gt; eigvals, eigvecs = torch.linalg.eig (m)
&gt;&gt;&gt; m.type(torch.complex64) @ eigvecs[0] - eigvals[0] * eigvecs[0]
tensor([ 0.8314-0.0995j, -2.1299+0.0442j, -2.9472+0.0204j,  2.5143+0.0372j,
         1.4673+0.0518j,  0.5620+0.0077j, -0.1461+0.5008j, -0.4469-0.4292j])
&gt;&gt;&gt; m.type(torch.complex64) @ eigvecs[:,0] - eigvals[0] * eigvecs[:,0]
tensor([ 3.5763e-07+0.j,  5.9605e-07+0.j,  4.7684e-07+0.j,  2.3842e-07+0.j,
         3.5763e-07+0.j,  2.3842e-07+0.j, -2.3842e-07+0.j,  1.1921e-07+0.j])
</code></pre>
<p>Best.</p>
<p>K. Frank</p>
Ptorch.jit._overload_method documentation

Padarn_Wilson: <p>Hi all,</p>
<p>I’m seeing use of <code>torch.jit._overload_method</code> in a library I am investigating, but I cannot see documentation on what this does at all?</p>
<p>I can guess the effect from the source code, but it would be nice to not be guessing,</p>

JinroTorch: <p>Hi! Any update on this? I have found this too.</p>
Possible values of TORCH_CUDA_ARCH_LIST

osman_bayram: <p>What are the possible values of this environment variable? And what do they mean? I could not find a documentation page.<br>
I have seen these examples over the internet:<br>
TORCH_CUDA_ARCH_LIST=Turing<br>
TORCH_CUDA_ARCH_LIST=“6.1 8.6”</p>

ptrblck: <p>You can specify GPU architectures and compute capabilities using this env variable to build native PyTorch CUDA kernels for the desired GPUs. Check the <a href="https://en.wikipedia.org/wiki/CUDA"><code>Compute Capability</code> section</a> to see which GPU uses which architecture.</p>
Dual GPU Setup: Memory allocating to one GPU while running on the other?

DevilryAscended: <p>My code is on the public repo here: <a href="https://github.com/Johnmakuta/NeuralTrauma" class="inline-onebox" rel="noopener nofollow ugc">GitHub - Johnmakuta/NeuralTrauma: Project to simulate the degradation of performance of a Spiking Neural Network (SNN) under the consequences of a hardware attack.</a></p>
<p>I have a setup with dual 3090tis with an NVlink bridge between them. I am getting this weird behavior when I run my eval_net_Rleaky.ipynb where when I’m running my model evaluation block it seeminly is running the code on one GPU and using the memory of the other.</p>
<p>In task manager, it shows one GPU at 14-16% utilization consistently, but showed next to now vram usage, but on the other GPU shows 0% utilization but it’s vram is continually increasing as the code runs.</p>
<p>Is this happening because of NVlink? I haven’t really delved into it since building the PC but I remember reading somewhere that NVlink when utilizing a single GPU could utilize the vram from the other GPU as it’s own but I thought that behavior had to be setup explicitly.</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/e/a/ea769d92f3954381cb88c0832c89b6c4df6d8adc.png" data-download-href="https://discuss.pytorch.org/uploads/default/ea769d92f3954381cb88c0832c89b6c4df6d8adc" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/e/a/ea769d92f3954381cb88c0832c89b6c4df6d8adc_2_690x397.png" alt="image" data-base62-sha1="xs9RmqidUmFyA3rM1Lzw8mCkGpC" width="690" height="397" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/e/a/ea769d92f3954381cb88c0832c89b6c4df6d8adc_2_690x397.png, https://discuss.pytorch.org/uploads/default/optimized/3X/e/a/ea769d92f3954381cb88c0832c89b6c4df6d8adc_2_1035x595.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/e/a/ea769d92f3954381cb88c0832c89b6c4df6d8adc_2_1380x794.png 2x" data-dominant-color="F6F8FA"><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">1418×817 47 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>

ptrblck: <p>Your task manager view does not shop the compute, so either add it as another plot or use <code>nvidia-smi</code> to check the compute utilization of your GPUs.</p>
'Fixing' Output Shape of the model layers in Pytorch model

nbansal90: <p>I have a pytorch model for a specific computer vision task. And when I print the model summary using:</p>
<pre><code class="lang-auto">from torchsummary import summary
model = Model() &lt;- Call to Model
summary(model, (3, 256, 256))
</code></pre>
<p>I get the following output:</p>
<pre><code class="lang-auto">----------------------------------------------------------------
        Layer (type)               Output Shape         Param #
================================================================
            Conv2d-1         [-1, 48, 256, 256]           1,296
 OverlapPatchEmbed-2         [-1, 48, 256, 256]               0
BiasFree_LayerNorm-3            [-1, 65536, 48]              48
         LayerNorm-4         [-1, 48, 256, 256]               0
            Conv2d-5        [-1, 144, 256, 256]           6,912
            Conv2d-6        [-1, 144, 256, 256]           1,296
            Conv2d-7         [-1, 48, 256, 256]           2,304
         Attention-8         [-1, 48, 256, 256]               0
BiasFree_LayerNorm-9            [-1, 65536, 48]              48
        LayerNorm-10         [-1, 48, 256, 256]               0
                                     .
                                     .

</code></pre>
<p>Now this means the size of the tensor is <code>dynamic</code> depending upon the batch size of the input. I want to do away this and <code>hardcode/fix</code> the <code>Output Shape</code>, such that <code>Output Shape</code> for each layer of my model becomes <code>Static</code>(with batch size = 1). For example, in the above scenario it should show <code>Conv2d-1</code> Output shape   [-1, 48, 256, 256]  as [1, 48, 256, 256] (such that pytorch summary also shows this).</p>
<p>How can I achieve this ? I require this as when I convert my pytorch model to tflite it complains about this dynamic nature of the tensor shape.</p>
<p>Any help/suggestions would be helpful.<br>
<strong>PS</strong>: I tried hardcoding the output of each layers to be of static shape such that batch size is 1 inside the <code>forward</code> function of each layers, using</p>
<pre><code class="lang-auto">out = model_layer()
out = out.view(1, out.shape[0],  out.shape[1], out.shape[2])
</code></pre>
<p>But this did not work, as I still get the same output from torch summary.</p>
<p>Regards!</p>

nbansal90: <p>This issue stops me from correctly running my tflite model on GPU. Where <code>it complains about presence of dynamic-sized tensors in the computational graph</code>. I converted my Pytorch Model → ONNX → Tflite Model then running on GPU on a smartphone. Investigating this issue, I ran <code>Pytorch Summary</code> shows Batch Size=-1, which reflects dynamic-sized tensor.</p>
<p>I am speculating this might be the reason why I am getting the afore-mentioned error. Eventhough I explicitly set the batch size as 1, inside the forward function of each layers, I still see the <code>-1</code> as the batch size under <code>Pytorch Summary</code>.</p>
<p>Any suggestion to resolve this issue would be really helpful.<br>
Regards!</p>
Problem with running Jupyter Notebook on NVIDIA GeForce RTX 4080

Afnan: <p>Hello,<br>
I’m working on Windows11 and have NVIDIA GeForce RTX 4080.<br>
I’ve created an environment in Anaconda, and installed python, cuda, cudnn as folllows:<br>
<strong>Python</strong>: 3.12.3<br>
<strong>cudatoolkit</strong>: 11.8.0<br>
<strong>cudnn</strong>: 8.9.2.26<br>
<strong># Name                    Version                   Build  Channel</strong><br>
cuda-cccl                 12.4.127                      0    nvidia<br>
cuda-cudart               12.4.127                      0    nvidia<br>
cuda-cudart-dev           12.4.127                      0    nvidia<br>
cuda-cupti                12.4.127                      0    nvidia<br>
cuda-libraries            12.4.0                        0    nvidia<br>
cuda-libraries-dev        12.4.0                        0    nvidia<br>
cuda-nvrtc                12.4.127                      0    nvidia<br>
cuda-nvrtc-dev            12.4.127                      0    nvidia<br>
cuda-nvtx                 12.4.127                      0    nvidia<br>
cuda-opencl               12.4.127                      0    nvidia<br>
cuda-opencl-dev           12.4.127                      0    nvidia<br>
cuda-profiler-api         12.4.127                      0    nvidia<br>
cuda-runtime              12.4.0                        0    nvidia<br>
cudatoolkit               11.8.0               hd77b12b_0<br>
pytorch-cuda              12.4                 h3fd98bf_6    pytorch</p>
<p>However, the output of the following code is still false:</p>
<pre><code class="lang-auto">import torch
torch.cuda.is_available()
</code></pre>
<p>Could you please help me how to run a Jupyter Notebook on GPU</p>
Torch.cuda.is_available() returns False for CUDA 12.3

lnyk: <p>the first line from output of nvidia-smi command is:</p>
<pre><code class="lang-auto">+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.23.08      Driver Version: 545.23.08    CUDA Version: 12.3     |
|-----------------------------------------+----------------------+----------------------
</code></pre>
<p>I have NVIDIA L40S GPU</p>
<p>I am trying to install pytorch but failed so far with everything I tries I always get False from<br>
torch.cuda.is_available()</p>
<p>Can anybody help?</p>
<p>Thanks</p>

ptrblck: <p>You might have installed the CPU-only PyTorch binary and should make sure the right PyTorch binary shipping with CUDA dependencies was installed via <code>pip list | grep torch</code> and <code>print(torch.version.cuda)</code>.<br>
If that’s not the case, your system might have an issue with the NVIDIA driver and you might need to reinstall it.</p>

lnyk: <p><a class="mention" href="/u/ptrblck">@ptrblck</a> Thanks for quick reply<br>
Following is the output from <code>pip list | grep torch</code></p>
<blockquote>
<p>torch                     2.3.0<br>
torchaudio                2.3.0<br>
torchvision               0.18.0</p>
</blockquote>
<p>output from print(torch.version.cuda):</p>
<blockquote>
<p><strong>12.1</strong></p>
</blockquote>

lnyk: <p>Thanks It works now. I was actually not having access to GPU in my environment, after turning it on it works.</p>

ptrblck: <p>Could you describe what exactly this means and how you’ve “turned on” your GPU?</p>

lnyk: <p>I initially used a CPU-only server, that’s why torch.cuda.is_available() returned false. After enabling the GPU, it started working.</p>
Error that and I install pytorch and dependency problem

Baptiste_Ismedon: <p>Hello,<br>
I’m new and I don’t understand why I have this error and how to fix it. I’ve tried deleting it, reinstalling it, downloading it locally etc. but nothing works (I’m sure it’s something stupid…).<br>
Thanks in advance</p>
<p>Exception has occurred: OSError<br>
[WinError 126] Le module spécifié est introuvable. Error loading “C:\Users\ismedonb\AppData\Roaming\Python\Python312\site-packages\torch\lib\shm.dll” or one of its dependencies.<br>
File “PATH”, line 1, in <br>
import torch<br>
OSError: [WinError 126] Le module spécifié est introuvable. Error loading “C:\Users\ismedonb\AppData\Roaming\Python\Python312\site-packages\torch\lib\shm.dll” or one of its dependencies.</p>

ptrblck: <p>Related to <a href="https://discuss.pytorch.org/t/cuda-not-available-for-rtx-6000-mobile/202160/12">this issue</a>.<br>
Use the proposed workaround or install the nightly to fix this.</p>
How to applying quantization model on CUDA?

elinliu0823: <p>Hi ! I’m a newbie for quantizationing.I’ve met a problem during using quantization like below error output:</p>
<pre data-code-wrap="bash"><code class="lang-bash">'quantized::embedding_byte' is only available for these backends: [CPU, Meta,   
BackendSelect, Python, FuncTorchDynamicLayerBackMode,   
Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, 
AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, 
AutogradLazy, AutogradMeta, Tracer, AutocastCPU, AutocastCUDA, 
FuncTorchBatched, BatchedNestedTensor, 
FuncTorchVmapMode, Batched, VmapMode, 
FuncTorchGradWrapper, PythonTLSSnapshot, 
FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].
</code></pre>
<p>When i fall backing into CPU,it raised another error:</p>
<pre data-code-wrap="bash"><code class="lang-bash">RuntimeError: quantized::linear_dynamic() Expected a value of type 'Tensor' for argument 'X' but instead found type 'method'.
Position: 0
</code></pre>
<p>Here is the quantization code i write for:</p>
<pre data-code-wrap="python"><code class="lang-python"># Applying Dynamic Quantization to the model
for _, mod in model_fp32.named_modules():
    if isinstance(mod, torch.nn.Embedding):
        mod.qconfig = torch.ao.quantization.float_qparams_weight_only_qconfig
model_qint8 = torch.ao.quantization.quantize_dynamic(
    model_fp32, 
    {
        torch.nn.Embedding,
        torch.nn.Linear
    },
    dtype=torch.qint8
)
</code></pre>
<p>Is there any i messed up or something,please help me. <img src="https://discuss.pytorch.org/images/emoji/apple/sob.png?v=12" title=":sob:" class="emoji" alt=":sob:" loading="lazy" width="20" height="20"></p>
Who can please tell me why the torchvision.io.read_video()function returns the defferent duration of vision and audio

g2532214352: <p>‘’’<br>
video_tensor, audio_tensor, info = read_video(video_path, start_pts=10, end_pts=20, pts_unit=“sec”)<br>
frame_rate = info[“video_fps”]<br>
sample_rate = info[“audio_fps”]</p>
<p>print(video_tensor.shape[0]/frame_rate)<br>
print(audio_tensor.shape[1]/sample_rate)<br>
‘’’<br>
the duration is defferent, the former is 34.892712724434034, while the latter is 31.79925<br>
the frame_rate is 11.72164523951137 and the sample_rate is 48,000</p>

g2532214352: <p><strong>Now I found that the original video had some stuttering and frame drops</strong><br>
maybe it’s the reason</p>
Any chance to quantize a torchscript model using pt2e?

siahuat0727: <p>I am exploring pt2e quantization and want to quantize a torchscript model using pt2e, but I failed to convert a torchscript to torch.export.</p>
<p>I wonder if there is any chance to quantize a torchscript model using pt2e? Thanks.</p>
<pre data-code-wrap="python"><code class="lang-python">import torch

m = torch.nn.Conv2d(3, 3, 3)
m = torch.jit.script(m)
inputs = (torch.rand(1, 3, 32, 32), )
m(*inputs)

import torch.export._trace
torch.export._trace._export(m, inputs, pre_dispatch=True)
</code></pre>
<p>Error message:</p>
<pre><code class="lang-auto"> gm_torch_level, _ = torch._dynamo.export(
  File ".../python3.8/site-packages/torch/_dynamo/eval_frame.py", line 1356, in inner
    assert (
AssertionError: Failed to produce a graph during tracing as no tensor operations were found.
</code></pre>
How to dynamically modify parameters (specifically weights) during forward pass?

thinking_tower: <p>Context:<br>
Progressive Growing Of GANs For Improved Quality, Stability, And Variation<br>
(https:// arxiv .org /pdf/1710.10196.pdf) <code># I'm a new user, hence can't have more than 2 links</code></p>
<p>Specifically,<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/8/860bdd31c66f3b8468e4355576ea08089549c263.png" data-download-href="https://discuss.pytorch.org/uploads/default/860bdd31c66f3b8468e4355576ea08089549c263" title="Equalized_LR"><img src="https://discuss.pytorch.org/uploads/default/optimized/2X/8/860bdd31c66f3b8468e4355576ea08089549c263_2_690x265.png" alt="Equalized_LR" data-base62-sha1="j7PoMb57yVGJyaMeFxmeNUzrM4j" width="690" height="265" srcset="https://discuss.pytorch.org/uploads/default/optimized/2X/8/860bdd31c66f3b8468e4355576ea08089549c263_2_690x265.png, https://discuss.pytorch.org/uploads/default/original/2X/8/860bdd31c66f3b8468e4355576ea08089549c263.png 1.5x, https://discuss.pytorch.org/uploads/default/original/2X/8/860bdd31c66f3b8468e4355576ea08089549c263.png 2x" data-dominant-color="DDDDE3"><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">Equalized_LR</span><span class="informations">753×290 113 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>
<hr>
<p>I’ve found two (vaguely) similar questions here:</p>
<ol>
<li>
<p><a href="https://discuss.pytorch.org/t/changing-weight-after-forward-and-before-backward/11145/7" class="inline-onebox">Changing weight after forward and before backward - #7 by SimonW</a></p>
</li>
<li>
<p><a href="https://discuss.pytorch.org/t/adjusting-parameters-in-the-forward-pass/40326" class="inline-onebox">Adjusting parameters in the forward pass</a>.</p>
</li>
</ol>
<p>Currently, this is my implementation (which I suspect to be wrong):</p>
<pre><code class="lang-auto">class WeightScaledModule(nn.Module):
    def __init__(self, module):
        super().__init__()
        self.module = module
        self.weight = self.module.weight
    def forward(self, x):
        fan = torch.nn.init._calculate_correct_fan(self.module.weight, 'fan_in')
        self.module.weight = nn.Parameter(self.module.weight * (2/fan)**.5)
        return self.module(x)
</code></pre>
<p>Any help on how to “dynamically” adjust parameters would be appreciated!</p>

SimonW: <p>I implemented it as <a href="https://gist.github.com/SsnL/44b082499381478150abfeabaf2701d2" rel="nofollow noopener">https://gist.github.com/SsnL/44b082499381478150abfeabaf2701d2</a>, and it seems to work.</p>

shipley223: <p>Could you please show you code here?</p>
AttributeError: 'Series' object has no attribute 'read'

Ozcan_Kucuk: <p>import matplotlib.pyplot as plt</p>
<p>def show_random_images(dataset, n=5):<br>
plt.figure(figsize=(10, 6))<br>
for i in range(n):<br>
idx = np.random.randint(len(dataset))<br>
img_path = dataset.iloc[idx][‘path’]<br>
print(“img_path:”, img_path)<br>
label = dataset.iloc[idx][‘label’]<br>
img = Image.open(img_path)   ???<br>
plt.subplot(1, n, i+1)<br>
plt.imshow(img)<br>
plt.title(‘Fake’ if label == 1 else ‘Real’)<br>
plt.axis(‘off’)<br>
plt.show()</p>
<p>AttributeError: ‘Series’ object has no attribute ‘read’  What is the reason for the error?</p>

mhm2020: <p>This error is not related to pytorch, however you can check contents of img_path</p>
YoloV9 : instance segmentation or object detection

Sylvain_Ard: <p>Hi,<br>
some people said to me that we can do instance segmentation with YoloV9 but I think it is only object detection, who is right please ?<br>
Thank you<br>
Best regards</p>

Sylvain_Ard: <p>I succeeded to make instance segmentation with yolov9 so it can do it</p>
Initialization of weights

sroyyors: <p>hi,<br>
I was wondering what is default initialization of weights in libtorch for say a convolutional layer? Is it just random?<br>
thanks,<br>
Sushmita</p>

ptrblck: <p>The parameters are initialized via the <code>reset_parameters()</code> function in <code>libtorch</code> and in the Python frontend. You could check the function for the corresponding layer, e.g. <a href="https://github.com/pytorch/pytorch/blob/037615b989b37b1bf5eff0c031055fc8d1fbe5ae/torch/csrc/api/include/torch/nn/modules/conv.h#L104-L114"><code>reset_parameters()</code> in conv.h</a> to see the actual initialization.</p>

sroyyors: <p>Thank you! I see so it is the kaiming_uniform. I looked at the source code in init.cpp and it uses the calculate_kaiming_std function which seems to be consistent with the pytorch documentation here: <a href="https://pytorch.org/docs/stable/nn.init.html" class="inline-onebox" rel="noopener nofollow ugc">torch.nn.init — PyTorch 2.3 documentation</a></p>
<p>The libtorch documentation was quite barebones, so I assume the above is what it is.</p>
<p>I would like to try a custom initialization since I feel my init parameters are not optimal (too big). I see a “hockey stick” profile in the loss where there is a big jump in the first iteration and then small bumps here and there.</p>
<p>Would you be able to provide some code to provide custom initialization of the weights?<br>
thanks,<br>
Sushmita</p>
Number of Iterations in Multi-GPU Setting?

Imahn: <p>I often see people referring to a certain number of iterations for a certain batch size on multiple GPUs, and was wondering how to interpret this.</p>
<p>For example, if it stated (as in the original ResNet paper) that the training lasted for 64k iterations and the batch size is 128 (64 per GPU) and 2 GPUs were used, do the 64k iterations refer to the number of iterations/GPU with a batch size of 64, or is it the number of iterations on both GPUs with a batch size of 64?</p>
Failing to export the Swin Transformer model into the Onnx file

ali_shahedi: <p>Hi everyone. I want to export the Pytorch Swin Transformer model into the Onnx format. However, I got the following error:</p>
<pre><code class="lang-auto">Traceback (most recent call last):
  File "/content/Rethinking_of_PAR/export_onnx.py", line 163, in &lt;module&gt;
    main(cfg, args)
  File "/content/Rethinking_of_PAR/export_onnx.py", line 105, in main
    torch.onnx.export(model, x, "swin_b.onnx", opset_version=12)
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/utils.py", line 516, in export
    _export(
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/utils.py", line 1613, in _export
    graph, params_dict, torch_out = _model_to_graph(
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/utils.py", line 1139, in _model_to_graph
    graph = _optimize_graph(
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/utils.py", line 677, in _optimize_graph
    graph = _C._jit_pass_onnx(graph, operator_export_type)
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/utils.py", line 1957, in _run_symbolic_function
    return symbolic_fn(graph_context, *inputs, **attrs)
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/symbolic_opset9.py", line 7153, in onnx_placeholder
    return torch._C._jit_onnx_convert_pattern_from_subblock(block, node, env)
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/utils.py", line 1957, in _run_symbolic_function
    return symbolic_fn(graph_context, *inputs, **attrs)
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/symbolic_opset11.py", line 311, in index_put
    values = symbolic_helper._reshape_helper(g, values, values_shape)
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/symbolic_helper.py", line 1418, in _reshape_helper
    return g.op("Reshape", input, shape)
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/_internal/jit_utils.py", line 87, in op
    return _add_op(self, opname, *raw_args, outputs=outputs, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/_internal/jit_utils.py", line 246, in _add_op
    node = _create_node(
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/_internal/jit_utils.py", line 307, in _create_node
    _C._jit_pass_onnx_node_shape_type_inference(node, params_dict, opset_version)
RuntimeError: minus_one_pos != -1 INTERNAL ASSERT FAILED at "../torch/csrc/jit/passes/onnx/shape_type_inference.cpp":534, please report a bug to PyTorch. There are no examples for shape_has_zero = true &amp;&amp; minus_one_pos == -1.
</code></pre>
<p>The default input size of the model is (batch_size, 3, 256, 192). When I use other input sizes like : (batch_size, 3, 256, 256) or (batch_size, 3, 256, 255), it works without any errors. However, I get the mentioned error with the default input size(batch_size, 3, 256, 192).<br>
Could you please help me to fix this problem?</p>
mIoU for PascalVOC 2012 stalls at 0.4724

richardatpytorch: <p>I get a strange phenomenon where the mIoU metric on PascalVOC 2012 is always 0.4724, no matter how I switch the backbone and segmentation head, and no matter how the loss becomes (it even becomes <code>nan</code> with my current setup). What could be the reason for this phenomenon? To put more context, I have tried variations of <code>resnet</code> as the backbone with <code>deeplab head</code> as the decoder head.</p>
For multiple GPUs Huggingface Transformer: torch.cuda.empty_cache() stuck

Animesh_Kumar_Paul: <p><a href="https://github.com/huggingface/transformers/blob/835de4c8335f72a9c53178f54cc3b4c0688960ec/src/transformers/trainer.py#L3219" rel="noopener nofollow ugc">https://github.com/huggingface/transformers/blob/835de4c8335f72a9c53178f54cc3b4c0688960ec/src/transformers/trainer.py#L3219</a></p>
<blockquote>
<p>torch.cuda.empty_cache()</p>
</blockquote>
<p>For the multiple GPUs, it stucks at this line forever - at that time there is no GPU usage, but has CPU usage.</p>
<p>Does anyone have any idea about it?</p>
Model.pth crash python in windows environment

al_aI: <p>I’m running python 3.11 in a virtual environment (venv) pytopch<br>
Latest Windows 11, Home</p>
<p>after execute the quickstart tutorial and generate a model.pth file, I can no longer invoke a simple python command</p>
<p>The .pth file is treated as a path configuration file! thus invalid character map</p>
<p>before:<br>
$ python -m pip -V</p>
<blockquote>
<p>pip 24.0 from C:\Users\xxxxx\pytorch\Lib\site-packages\pip (python 3.11)</p>
</blockquote>
<p>after:<br>
$ python -m pip -V</p>
<blockquote>
<p>Fatal Python error: init_import_site: Failed to import the site module<br>
Python runtime state: initialized<br>
Traceback (most recent call last):<br>
File “”, line 1176, in _find_and_load<br>
File “”, line 1147, in _find_and_load_unlocked<br>
File “”, line 690, in _load_unlocked<br>
File “”, line 980, in exec_module<br>
File “”, line 616, in <br>
File “”, line 599, in main<br>
File “”, line 531, in venv<br>
File “”, line 384, in addsitepackages<br>
File “”, line 226, in addsitedir<br>
File “”, line 179, in addpackage<br>
File “C:\Python311\Lib\encodings\cp1252.py”, line 23, in decode<br>
return codecs.charmap_decode(input,self.errors,decoding_table)[0]<br>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>
UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x8d in position 1276: character maps to </p>
</blockquote>
<p>The reason is clear if I use python -v -m pip -V</p>
<blockquote>
<p>…<br>
import ‘os’ # &lt;class ‘_frozen_importlib.FrozenImporter’&gt;<br>
import ‘_sitebuiltins’ # &lt;class ‘_frozen_importlib.FrozenImporter’&gt;<br>
Processing global site-packages<br>
Adding directory: ‘C:\Users\xxxxx\pytorch’<br>
Processing .pth file: ‘C:\Users\xxxxx\pytorch\model.pth’<br>
Fatal Python error: init_import_site: Failed to import the site module<br>
Python runtime state: initialized<br>
Traceback (most recent call last):<br>
File “”, line 1176, in _find_and_load<br>
File “”, line 1147, in _find_and_load_unlocked<br>
…</p>
</blockquote>
Warmup learning rate and optimizer

Aakira: <p>Hello everyone. I came across some code that was written like this (I’m using pseudocode for easier tracking):</p>
<pre><code class="lang-auto">for iter, image :
   warmup.step() 
   loss.backward()
   if iter % 16 == 0 :
     optimizer.step()
</code></pre>
<p>From my understanding, performing warmup at each iteration like this doesn’t have any effect because warmup changes the learning rate 16 times before calling optimizer.step(), but the optimizer only uses the last changed learning rate, is that correct?</p>

Tony-Y: <p>The optimizer uses the learning rate of each group in <code>optimizer.param_groups</code>. If <code>warmup.step()</code> changes it, then I think your understanding is correct.</p>
Can I use Pythorch logo? website, social media

Cesar_Rojas: <p>I’ve just created a data science training blog in Spanish. Was wondering if I could insert Pytorch logo in few of my posts without problem? posts would be in website and social media sites (instagram, fb, twitter, etc). Thanks</p>
<p>Sincerely,<br>
Cesar Rojas G.</p>

ptrblck: <p>CC’ing <a class="mention" href="/u/smth">@smth</a> <a class="mention" href="/u/jspisak">@jspisak</a> to chime in <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>

jspisak: <p>thanks for asking! Yes, you can and the guidelines can be found here: <a href="https://pytorch.org/assets/brand-guidelines/PyTorch-Brand-Guidelines.pdf">https://pytorch.org/assets/brand-guidelines/PyTorch-Brand-Guidelines.pdf</a></p>
<p>btw, please also send me an email and I can plug you in with our mktg team to review the usage as well as help promote awareness on the PyTorch channels.</p>
<p><a href="mailto:jspisak@fb.com">jspisak@fb.com</a></p>
<p>cheers<br>
-Joe</p>

gavinminnis: <p>Hi Cesar,</p>
<p>I am also wanting to request permission to use the logo on a Texas Instruments webpage. I just tried to email Joe but it appears he no longer works at FB. Can you help connect me with the right person?</p>
<p>Thanks,<br>
Gavin</p>

ptrblck: <p>CC <a class="mention" href="/u/suraj.pt">@suraj.pt</a> as you might know a new contact</p>

suraj.pt: <p>thanks <a class="mention" href="/u/ptrblck">@ptrblck</a>, <a class="mention" href="/u/gavinminnis">@gavinminnis</a> Joe’s guidelines above are still valid</p>

yoshitomo-matsubara: <p>Hi <a class="mention" href="/u/suraj.pt">@suraj.pt</a> <a class="mention" href="/u/ptrblck">@ptrblck</a></p>
<p>I want to use PyTorch logos for my open-source projects and papers, too.</p>
<ol>
<li>Can we use the logos for such purposes?</li>
<li>Where can we download the logos?</li>
<li>Can we also use the logo as part of a logo for my OSS if we design the logo?</li>
</ol>

kiszk: <p>Hi <a class="mention" href="/u/jspisak">@jspisak</a><br>
I wonder if I could use the PyTorch logo in our presentation at <a href="https://www.ibm.com/jp-ja/events/techxchange#AH" rel="noopener nofollow ugc">the tech event</a>. [Sorry for being available only in the Japanese version]. If you have concerns, could you please let me know?<br>
Our presentation explains how our research addresses the connection between PyTorch and our AI accelerator.</p>

pu239: <p>Hi <a class="mention" href="/u/suraj.pt">@suraj.pt</a> <a class="mention" href="/u/ptrblck">@ptrblck</a>, could I also use the pytorch logo (slight modification) as part of the logo of an open-source project, <a href="https://github.com/plutonium-239/memsave_torch" rel="noopener nofollow ugc"><code>memsave_torch</code></a>?</p>
Is it possible to convert the GloVe Word Embedding from torchtext to a torchscript model?

SecretAsianMan92: <p>I am trying to utilize the GloVe word embedding for my RNN in DJL however after looking around one of the developers said “DJL uses PyTorch C++ API, it only support TorchScript model. You need trace your model.” I have a feeling when the dev mentions model in this context I think he is talking about a saved nn model after training and not a word embedding. Is it possible to take the glove.6B.50d.txt.pt word embedding file that is downloaded to my file system and convert it to TorchScript?</p>
<p>I got the word embedding by using the line:</p>
<pre><code class="lang-auto">torchtext.vocab.GloVe(name='6B', dim=50)
</code></pre>

ptrblck: <p>The word embedding sound be a tensor and you can directly load it in the C++ API. Tracing is used for models (or general function calls) as you’ve described.</p>

SecretAsianMan92: <p>I apologize I am not trying to get someone to do my work its just that some of this is going over my head.</p>
<p>So if I load the glove.6B.50d.txt.pt file and load it into the C++ API I should be able to trace it and get the torchscript model?</p>

ptrblck: <aside class="quote no-group" data-username="SecretAsianMan92" data-post="3" data-topic="202452">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/s/e99b99/48.png" class="avatar"> SecretAsianMan92:</div>
<blockquote>
<p>I apologize I am not trying to get someone to do my work its just that some of this is going over my head.</p>
</blockquote>
</aside>
<p>Of course and I did not have the impression you are trying to offload your work.</p>
<aside class="quote no-group" data-username="SecretAsianMan92" data-post="3" data-topic="202452">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/s/e99b99/48.png" class="avatar"> SecretAsianMan92:</div>
<blockquote>
<p>So if I load the glove.6B.50d.txt.pt file and load it into the C++ API I should be able to trace it and get the torchscript model?</p>
</blockquote>
</aside>
<p>The glove embedding is a tensor, not a model. It just contains the data and you would have to create the model separately to be able to trace it.</p>

SecretAsianMan92: <p>Oooh ok. Ok then that is my next bit of research to do. Thanks!</p>
Bottleneck in dataloader with torchaudio

aftoul: <p>Hi,<br>
This is my first post here, so it might be a noob question.<br>
I’ve been experiencing an issue where my dataloader that reads audio files from disk is causing a bottleneck. The GPU is stuck at about 50% utilization. And looking at the CPU cores with htop, it’s only using about 2.5 to 3 threads out of the 12 on my CPU. I’ve confirmed the data reads are only about 10MB/s which is far from the top speed of my SSD.</p>
<p>If you’re wondering, I had compiled torchaudio myself on ArchLinux with FFmpeg support. My CPU is a Ryzen 5 with 6 cores, 12 threads.</p>
<pre><code class="lang-auto">class AudioFolderDataset(Dataset):
    def __init__(self, root,
                 target_sample_rate=target_sample_rate,
                 target_length_sec=target_length_sec, 
                 randomize=True, class_to_idx=None,
                 randomize_prob=.5):
        self.root = root
        classes = sorted(os.listdir(root))
        self.class_to_idx = class_to_idx or {cls: i for i, cls in enumerate(classes)}
        self.samples = self._make_dataset()
        self.randomize_prob = randomize_prob
        self.randomize = randomize
        self.target_length_sec = target_length_sec
        self.target_sample_rate = target_sample_rate

    def _make_dataset(self):
        samples = []
        for class_name, class_idx in self.class_to_idx.items():
            class_path = os.path.join(self.root, class_name)
            for subdir in os.listdir(class_path):
                sub_path = os.path.join(class_path, subdir)
                for file_name in os.listdir(sub_path):
                    path = os.path.join(sub_path, file_name)
                    item = (path, class_idx)
                    samples.append(item)
        return samples

    def __len__(self):
        return len(self.samples)

    def get_labels(self):
        return [s[1] for s in self.samples]

    def get_random(self):
        if not hasattr(self, '_rand_gen'):
            self._rand_gen = random.Random()
        return self._rand_gen

    def __getitem__(self, idx):
        path, label = self.samples[idx]
        rand_gen = self.get_random()
        randomize = self.randomize and (rand_gen.random() &lt; self.randomize_prob)
        #ainfo = info(path, backend='ffmpeg')
        offset = 0
        target_length = target_sample_rate * self.target_length_sec
        
        waveform, sample_rate = load(
                path,
                num_frames=target_length,
                frame_offset=offset,
                backend='ffmpeg'
                )
        if sample_rate != self.target_sample_rate:
            waveform = Resample(sample_rate, self.target_sample_rate)(waveform)
            sample_rate = self.target_sample_rate
        target = sample_rate*target_length_sec
        return waveform, label, path
train_dataset = AudioFolderDataset(
        'data/train/', randomize=True
)
train_dataloader = DataLoader(
    train_dataset, batch_size=batch_size, num_workers=12, shuffle=True, pin_memory=True
)
</code></pre>
<p>Thanks in advance</p>
Understanding GPU memory visualization result

111357: <aside class="onebox allowlistedgeneric" data-onebox-src="https://pytorch.org/blog/understanding-gpu-memory-1/">
  <header class="source">
      <img src="https://pytorch.org/favicon.ico?" class="site-icon" width="32" height="32">

      <a href="https://pytorch.org/blog/understanding-gpu-memory-1/" target="_blank" rel="noopener nofollow ugc">PyTorch</a>
  </header>

  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:690/362;"><img src="https://pytorch.org/assets/images/social-share.jpg" class="thumbnail" width="690" height="362"></div>

<h3><a href="https://pytorch.org/blog/understanding-gpu-memory-1/" target="_blank" rel="noopener nofollow ugc">Understanding GPU Memory 1: Visualizing All Allocations over Time</a></h3>

  <p>During your time with PyTorch on GPUs, you may be familiar with this common error message:</p>


  </article>

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

  <div style="clear: both"></div>
</aside>
<p>
There is a great tool for visualizing GPU memory. But I am a little confused about the <code>allocator state history</code>. Could someone assist in labeling the colors and the four rectangles?</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/e/8efe1318ea9161138c1ec5aa96e35831697e6e9e.png" data-download-href="https://discuss.pytorch.org/uploads/default/8efe1318ea9161138c1ec5aa96e35831697e6e9e" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/8/e/8efe1318ea9161138c1ec5aa96e35831697e6e9e_2_690x278.png" alt="image" data-base62-sha1="koY9uB8l2UZiXqON3tCMe4XJSuW" width="690" height="278" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/8/e/8efe1318ea9161138c1ec5aa96e35831697e6e9e_2_690x278.png, https://discuss.pytorch.org/uploads/default/optimized/3X/8/e/8efe1318ea9161138c1ec5aa96e35831697e6e9e_2_1035x417.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/8/e/8efe1318ea9161138c1ec5aa96e35831697e6e9e_2_1380x556.png 2x" data-dominant-color="E7E4E2"><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">2169×875 145 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>

111357: <p>Hi <a class="mention" href="/u/ptrblck">@ptrblck</a> do you have any insights about this <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=12" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>