class_docstr: __init__(self, in_channels, out_channels, ksize=None, stride=1, pad=0, nobias=False, initialW=None, initial_bias=None, *, dilate=1, groups=1)
  
  Two-dimensional convolutional layer.
  
  This link wraps the :func:`~chainer.functions.convolution_2d` function and
  holds the filter weight and bias vector as parameters.
  
  The output of this function can be non-deterministic when it uses cuDNN.
  If ``chainer.configuration.config.deterministic`` is ``True`` and
  cuDNN version is >= v3, it forces cuDNN to use a deterministic algorithm.
  
  Convolution links can use a feature of cuDNN called autotuning, which
  selects the most efficient CNN algorithm for images of fixed-size,
  can provide a significant performance boost for fixed neural nets.
  To enable, set `chainer.using_config('autotune', True)`
  
  Args:
      in_channels (int or None): Number of channels of input arrays.
          If ``None``, parameter initialization will be deferred until the
          first forward data pass at which time the size will be determined.
      out_channels (int): Number of channels of output arrays.
      ksize (int or pair of ints): Size of filters (a.k.a. kernels).
          ``ksize=k`` and ``ksize=(k, k)`` are equivalent.
      stride (int or pair of ints): Stride of filter applications.
          ``stride=s`` and ``stride=(s, s)`` are equivalent.
      pad (int or pair of ints): Spatial padding width for input arrays.
          ``pad=p`` and ``pad=(p, p)`` are equivalent.
      nobias (bool): If ``True``, then this link does not use the bias term.
      initialW (:ref:`initializer <initializer>`): Initializer to
          initialize the weight. When it is :class:`numpy.ndarray`,
          its ``ndim`` should be 4.
      initial_bias (:ref:`initializer <initializer>`): Initializer to
          initialize the bias. If ``None``, the bias will be initialized to
          zero. When it is :class:`numpy.ndarray`, its ``ndim`` should be 1.
      dilate (int or pair of ints):
          Dilation factor of filter applications.
          ``dilate=d`` and ``dilate=(d, d)`` are equivalent.
      groups (:class:`int`): Number of groups of channels. If the number
          is greater than 1, input tensor :math:`W` is divided into some
          blocks by this value channel-wise. For each tensor blocks,
          convolution operation will be executed independently. Input channel
          size ``in_channels`` and output channel size ``out_channels`` must
          be exactly divisible by this value.
  
  .. seealso::
     See :func:`chainer.functions.convolution_2d` for the definition of
     two-dimensional convolution.
  
  Attributes:
      W (~chainer.Variable): Weight parameter.
      b (~chainer.Variable): Bias parameter.
  
  .. admonition:: Example
  
      There are several ways to make a Convolution2D link.
  
      Let an input vector ``x`` be:
  
      >>> x = np.arange(1 * 3 * 10 * 10, dtype=np.float32).reshape(
      ...     1, 3, 10, 10)
  
      1. Give the first three arguments explicitly:
  
          >>> l = L.Convolution2D(3, 7, 5)
          >>> y = l(x)
          >>> y.shape
          (1, 7, 6, 6)
  
      2. Omit ``in_channels`` or fill it with ``None``:
  
          The below two cases are the same.
  
          >>> l = L.Convolution2D(7, 5)
          >>> y = l(x)
          >>> y.shape
          (1, 7, 6, 6)
  
          >>> l = L.Convolution2D(None, 7, 5)
          >>> y = l(x)
          >>> y.shape
          (1, 7, 6, 6)
  
          When you omit the first argument, you need to specify the other
          subsequent arguments from ``stride`` as keyword auguments. So the
          below two cases are the same.
  
          >>> l = L.Convolution2D(7, 5, stride=1, pad=0)
          >>> y = l(x)
          >>> y.shape
          (1, 7, 6, 6)
  
          >>> l = L.Convolution2D(None, 7, 5, 1, 0)
          >>> y = l(x)
          >>> y.shape
          (1, 7, 6, 6)
class_docstr_tok: ["__init__","(","self",",","in_channels",",","out_channels",",","ksize=None",",","stride=1",",","pad=0",",","nobias=False",",","initialW=None",",","initial_bias=None",",","*",",","dilate=1",",","groups=1",")","Two-dimensional","convolutional","layer",".","This","link","wraps","the",":","func",":","`","~chainer.functions.convolution_2d","`","function","and","holds","the","filter","weight","and","bias","vector","as","parameters",".","The","output","of","this","function","can","be","non-deterministic","when","it","uses","cuDNN",".","If","``","chainer.configuration.config.deterministic","``","is","``","True","``","and","cuDNN","version","is",">","=","v3",",","it","forces","cuDNN","to","use","a","deterministic","algorithm",".","Convolution","links","can","use","a","feature","of","cuDNN","called","autotuning",",","which","selects","the","most","efficient","CNN","algorithm","for","images","of","fixed-size",",","can","provide","a","significant","performance","boost","for","fixed","neural","nets",".","To","enable",",","set","`","chainer.using_config","(","'autotune","'",",","True",")","`","Args",":","in_channels","(","int","or","None",")",":","Number","of","channels","of","input","arrays",".","If","``","None","``",",","parameter","initialization","will","be","deferred","until","the","first","forward","data","pass","at","which","time","the","size","will","be","determined",".","out_channels","(","int",")",":","Number","of","channels","of","output","arrays",".","ksize","(","int","or","pair","of","ints",")",":","Size","of","filters","(","a.k.a",".","kernels",")",".","``","ksize=k","``","and","``","ksize=","(","k",",","k",")","``","are","equivalent",".","stride","(","int","or","pair","of","ints",")",":","Stride","of","filter","applications",".","``","stride=s","``","and","``","stride=","(","s",",","s",")","``","are","equivalent",".","pad","(","int","or","pair","of","ints",")",":","Spatial","padding","width","for","input","arrays",".","``","pad=p","``","and","``","pad=","(","p",",","p",")","``","are","equivalent",".","nobias","(","bool",")",":","If","``","True","``",",","then","this","link","does","not","use","the","bias","term",".","initialW","(",":","ref",":","`","initializer","<","initializer",">","`",")",":","Initializer","to","initialize","the","weight",".","When","it","is",":","class",":","`","numpy.ndarray","`",",","its","``","ndim","``","should","be","4.","initial_bias","(",":","ref",":","`","initializer","<","initializer",">","`",")",":","Initializer","to","initialize","the","bias",".","If","``","None","``",",","the","bias","will","be","initialized","to","zero",".","When","it","is",":","class",":","`","numpy.ndarray","`",",","its","``","ndim","``","should","be","1.","dilate","(","int","or","pair","of","ints",")",":","Dilation","factor","of","filter","applications",".","``","dilate=d","``","and","``","dilate=","(","d",",","d",")","``","are","equivalent",".","groups","(",":","class",":","`","int","`",")",":","Number","of","groups","of","channels",".","If","the","number","is","greater","than","1",",","input","tensor",":","math",":","`","W","`","is","divided","into","some","blocks","by","this","value","channel-wise",".","For","each","tensor","blocks",",","convolution","operation","will","be","executed","independently",".","Input","channel","size","``","in_channels","``","and","output","channel","size","``","out_channels","``","must","be","exactly","divisible","by","this","value",".","..","seealso",":",":","See",":","func",":","`","chainer.functions.convolution_2d","`","for","the","definition","of","two-dimensional","convolution",".","Attributes",":","W","(","~chainer.Variable",")",":","Weight","parameter",".","b","(","~chainer.Variable",")",":","Bias","parameter",".","..","admonition",":",":","Example","There","are","several","ways","to","make","a","Convolution2D","link",".","Let","an","input","vector","``","x","``","be",":",">",">",">","x","=","np.arange","(","1","*","3","*","10","*","10",",","dtype=np.float32",")",".reshape","(","...","1",",","3",",","10",",","10",")","1",".","Give","the","first","three","arguments","explicitly",":",">",">",">","l","=","L.Convolution2D","(","3",",","7",",","5",")",">",">",">","y","=","l","(","x",")",">",">",">","y.shape","(","1",",","7",",","6",",","6",")","2",".","Omit","``","in_channels","``","or","fill","it","with","``","None","``",":","The","below","two","cases","are","the","same",".",">",">",">","l","=","L.Convolution2D","(","7",",","5",")",">",">",">","y","=","l","(","x",")",">",">",">","y.shape","(","1",",","7",",","6",",","6",")",">",">",">","l","=","L.Convolution2D","(","None",",","7",",","5",")",">",">",">","y","=","l","(","x",")",">",">",">","y.shape","(","1",",","7",",","6",",","6",")","When","you","omit","the","first","argument",",","you","need","to","specify","the","other","subsequent","arguments","from","``","stride","``","as","keyword","auguments",".","So","the","below","two","cases","are","the","same",".",">",">",">","l","=","L.Convolution2D","(","7",",","5",",","stride=1",",","pad=0",")",">",">",">","y","=","l","(","x",")",">",">",">","y.shape","(","1",",","7",",","6",",","6",")",">",">",">","l","=","L.Convolution2D","(","None",",","7",",","5",",","1",",","0",")",">",">",">","y","=","l","(","x",")",">",">",">","y.shape","(","1",",","7",",","6",",","6",")"]
docstr: Applies the convolution layer.
  
  Args:
      x (~chainer.Variable): Input image.
  
  Returns:
      ~chainer.Variable: Output of the convolution.
docstr_tok: ["Applies","the","convolution","layer",".","Args",":","x","(","~chainer.Variable",")",":","Input","image",".","Returns",":","~chainer.Variable",":","Output","of","the","convolution","."]
code: def forward(self, x):
      """Applies the convolution layer.
  
      Args:
          x (~chainer.Variable): Input image.
  
      Returns:
          ~chainer.Variable: Output of the convolution.
  
      """
      x = chainer.as_variable(x)
      assert x.layout == self.x_layout
      # self.W can be a Variable instead of Parameter: #8462
      # TODO(niboshi): Use Parameter.is_initialized.
      if self.W.raw_array is None:
          _, c, _, _ = memory_layouts.get_semantic_shape(
              x, assumed_layout=self.x_layout
          )
          self._initialize_params(c)
      return convolution_2d.convolution_2d(
          x,
          self.W,
          self.b,
          self.stride,
          self.pad,
          dilate=self.dilate,
          groups=self.groups,
          cudnn_fast=self.cudnn_fast,
      )
  
file_path: chainer/chainer/links/connection/convolution_2d.py
imports: import chainer
  from chainer.functions.connection import convolution_2d
  from chainer import initializers
  from chainer import link
  from chainer import memory_layouts
  from chainer.utils import argument
  from chainer import variable
label_desc: Use image node_id 5 for calling the Convolution2D obj's underlying member method code with example usage: obj.forward(x) and returns: convolution_2d