title: Setting custom kernel for CNN in pytorch
body: <p>Is there a way to specify our own custom kernel values for a convolution neural network in pytorch? Something like <a href="https://www.tensorflow.org/versions/r1.0/api_docs/python/tf/layers/conv2d_transpose" rel="nofollow noreferrer">kernel_initialiser</a> in tensorflow? Eg. I want a 3x3 kernel in <code>nn.Conv2d</code> with initialization so that it acts as a identity kernel -</p>
  
  <p><code>0 0 0</code><br>
  <code>0 1 0</code><br>
  <code>0 0 0</code>  </p>
  
  <p>(this will effectively return the same output as my input in the very first iteration)</p>
  
  <p>My non-exhaustive research on the subject - </p>
  
  <p>I could use <a href="https://pytorch.org/docs/stable/_modules/torch/nn/init.html" rel="nofollow noreferrer">nn.init</a> but it only has some pre-defined kernel initialisaition values.</p>
  
  <p>I tried to follow the discussion on their <a href="https://discuss.pytorch.org/t/weight-initilzation/157/2" rel="nofollow noreferrer">official thread</a> but it doesn't suit my needs.</p>
  
  <p>I might have missed something in my research please feel free to point out.</p>