Cudnn_convolution_backward is not a member of 'at'

rinkujadhav2013: <p>Hi,<br>
I’m trying to adapt my code from version 1.10.2 to 1.11.0 (for now). I was using <code>cudnn_convolution_backward</code> in 1.10.2 but I’m unable to use in 1.11.0. It throws an error saying</p>
<blockquote>
<p>error: ‘cudnn_convolution_backward’ is not a member of ‘at’</p>
</blockquote>
<p>but I can see that the function is in the namespace <code>at</code> even for version 1.11.0:</p><aside class="onebox githubblob" data-onebox-src="https://github.com/pytorch/pytorch/blob/v1.11.0/aten/src/ATen/native/cudnn/ConvShared.cpp#L417">
  <header class="source">

      <a href="https://github.com/pytorch/pytorch/blob/v1.11.0/aten/src/ATen/native/cudnn/ConvShared.cpp#L417" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://github.com/pytorch/pytorch/blob/v1.11.0/aten/src/ATen/native/cudnn/ConvShared.cpp#L417" target="_blank" rel="noopener nofollow ugc">pytorch/pytorch/blob/v1.11.0/aten/src/ATen/native/cudnn/ConvShared.cpp#L417</a></h4>



    <pre class="onebox"><code class="lang-cpp">
      <ol class="start lines" start="407" style="counter-reset: li-counter 406 ;">
          <li>    const Tensor&amp; input_t,</li>
          <li>    IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups,</li>
          <li>    bool benchmark, bool deterministic, bool allow_tf32)</li>
          <li>{</li>
          <li>  return cudnn_convolution_backward_weight(</li>
          <li>      "cudnn_convolution_backward_weight",</li>
          <li>      weight_size, grad_output_t, input_t,</li>
          <li>      padding, stride, dilation, groups, benchmark, deterministic, allow_tf32);</li>
          <li>}</li>
          <li></li>
          <li class="selected">std::tuple&lt;at::Tensor,at::Tensor&gt; cudnn_convolution_backward(</li>
          <li>    const at::Tensor&amp; input, const at::Tensor&amp; grad_output_t, const at::Tensor&amp; weight,</li>
          <li>    IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups,</li>
          <li>    bool benchmark, bool deterministic, bool allow_tf32, std::array&lt;bool,2&gt; output_mask) {</li>
          <li></li>
          <li>  Tensor grad_output = grad_output_t.contiguous(input.suggest_memory_format());</li>
          <li></li>
          <li>  Tensor grad_input, grad_weight;</li>
          <li>  if (input.numel() == 0) {</li>
          <li>    if (output_mask[0]) {</li>
          <li>      grad_input = at::empty_like(input, LEGACY_CONTIGUOUS_MEMORY_FORMAT);</li>
      </ol>
    </code></pre>



  </article>

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

  <div style="clear: both"></div>
</aside>
<p>
I don’t see the difference between 1.11.0 and 1.10.2:</p><aside class="onebox githubblob" data-onebox-src="https://github.com/pytorch/pytorch/blob/v1.10.2/aten/src/ATen/native/cudnn/ConvShared.cpp#L393">
  <header class="source">

      <a href="https://github.com/pytorch/pytorch/blob/v1.10.2/aten/src/ATen/native/cudnn/ConvShared.cpp#L393" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://github.com/pytorch/pytorch/blob/v1.10.2/aten/src/ATen/native/cudnn/ConvShared.cpp#L393" target="_blank" rel="noopener nofollow ugc">pytorch/pytorch/blob/v1.10.2/aten/src/ATen/native/cudnn/ConvShared.cpp#L393</a></h4>



    <pre class="onebox"><code class="lang-cpp">
      <ol class="start lines" start="383" style="counter-reset: li-counter 382 ;">
          <li>    bool benchmark, bool deterministic, bool allow_tf32)</li>
          <li>{</li>
          <li>  TensorArg grad_output{ grad_output_t, "grad_output", 1 },</li>
          <li>            weight{ weight_t, "weight", 2 };</li>
          <li>  return cudnn_convolution_backward_input(</li>
          <li>      "cudnn_convolution_backward_input",</li>
          <li>      input_size, grad_output, weight,</li>
          <li>      padding, stride, dilation, groups, benchmark, deterministic, allow_tf32);</li>
          <li>}</li>
          <li></li>
          <li class="selected">std::tuple&lt;at::Tensor,at::Tensor&gt; cudnn_convolution_backward(</li>
          <li>    const at::Tensor&amp; input, const at::Tensor&amp; grad_output_t, const at::Tensor&amp; weight,</li>
          <li>    IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups,</li>
          <li>    bool benchmark, bool deterministic, bool allow_tf32, std::array&lt;bool,2&gt; output_mask) {</li>
          <li></li>
          <li>  Tensor grad_output = grad_output_t.contiguous(input.suggest_memory_format());</li>
          <li></li>
          <li>  Tensor grad_input, grad_weight;</li>
          <li>  if (input.numel() == 0) {</li>
          <li>    if (output_mask[0]) {</li>
          <li>      grad_input = at::empty_like(input, LEGACY_CONTIGUOUS_MEMORY_FORMAT);</li>
      </ol>
    </code></pre>



  </article>

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

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


ptrblck: <p>The <code>cudnn_*</code> methods are not exposed anymore and you should be able to drop the <code>cudnn_</code> prefix in newer PyTorch versions.</p>

rinkujadhav2013: <p>Can I also just use the <code>torch.ops.aten.convolution_backward</code> function (cuz I’m using C++ method in Python anyway) for pytorch versions &gt; 1.11.0?</p>