akankshakshurai/cuda-error-resolution-analysis huggingface dataset:
How do I make sure the output of a CNN never decrease in size using padding?

pinocchio: <p>I want to create one code such that no matter what task or input size the image is, it will always produce a ConvNet such that the padding is set such that <strong>the size of the features is always equal to the size of the original image</strong> (up until the end/final layer).</p>
<p>How does one do that in pytorch?</p>
<hr>
<p>I realized this might be useful:</p>
<aside class="quote" data-post="1" data-topic="19937">
  <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/a/4491bb/48.png" class="avatar">
    <a href="https://discuss.pytorch.org/t/same-convolution-in-pytorch/19937">'Same' convolution in pytorch</a> <a class="badge-category__wrapper " href="/c/vision/5"><span data-category-id="5" data-drop-close="true" class="badge-category " title="Topics related to either pytorch/vision or vision research related topics"><span class="badge-category__name">vision</span></span></a>
  </div>
  <blockquote>
    Hi, 
Is there a simple way to do ‘same’ convolution in pytorch such that the output spacial dimensions equals the input counterpart ? 
Best
  </blockquote>
</aside>

<hr>
<p>Cross posted with code:</p>
<aside class="onebox stackexchange" data-onebox-src="https://stackoverflow.com/questions/57294893/implementing-same-convolution-in-pytorch">
  <header class="source">

      <a href="https://stackoverflow.com/questions/57294893/implementing-same-convolution-in-pytorch" target="_blank" rel="noopener nofollow ugc">stackoverflow.com</a>
  </header>

  <article class="onebox-body">
      <a href="https://stackoverflow.com/users/1601580/charlie-parker" target="_blank" rel="noopener nofollow ugc">
    <img alt="Charlie Parker" src="https://i.stack.imgur.com/2B6rV.png?s=256&amp;g=1" class="thumbnail onebox-avatar" width="256" height="256">
  </a>

<h4>
  <a href="https://stackoverflow.com/questions/57294893/implementing-same-convolution-in-pytorch" target="_blank" rel="noopener nofollow ugc">Implementing same convolution in Pytorch</a>
</h4>

<div class="tags">
  <strong>python, conv-neural-network, pytorch</strong>
</div>

<div class="date">
  asked by
  
  <a href="https://stackoverflow.com/users/1601580/charlie-parker" target="_blank" rel="noopener nofollow ugc">
    Charlie Parker
  </a>
  on <a href="https://stackoverflow.com/questions/57294893/implementing-same-convolution-in-pytorch" target="_blank" rel="noopener nofollow ugc">04:03PM - 31 Jul 19 UTC</a>
</div>

  </article>

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

  <div style="clear: both"></div>
</aside>