code: def setUp(self):
      ndim = self.ndim
      dtype = self.dtype
      batches = 2
      if self.layout == libcudnn.CUDNN_TENSOR_NHWC:
          # channel size must be multiple of 4
          in_channels_a_group = 4
          out_channels_a_group = 4
      else:
          in_channels_a_group = 3
          out_channels_a_group = 2
      in_channels = in_channels_a_group * self.groups
      out_channels = out_channels_a_group * self.groups
      # TODO(anaruse): increase test cases.
      ksize = 3
      stride = 2
      pad = ksize // stride * self.dilate
      self.strides = (stride,) * ndim
      self.pads = (pad,) * ndim
      self.dilations = (self.dilate,) * ndim
      if self.layout == libcudnn.CUDNN_TENSOR_NHWC:
          self.x = cupy.zeros(
              (batches,) + (ksize,) * ndim + (in_channels,), dtype
          )
          self.W = cupy.zeros(
              (out_channels,)
              + (ksize,) * ndim
              + (in_channels_a_group,),
              dtype,
          )
          self.y = cupy.ones(
              (batches,) + (2,) * ndim + (out_channels,), dtype
          )
      else:
          self.x = cupy.zeros(
              (batches, in_channels) + (ksize,) * ndim, dtype
          )
          self.W = cupy.zeros(
              (out_channels, in_channels_a_group) + (ksize,) * ndim,
              dtype,
          )
          self.y = cupy.ones(
              (batches, out_channels) + (2,) * ndim, dtype
          )
      self.b = None
      if self.bias:
          self.b = cupy.zeros((out_channels,), dtype)
  
      version = libcudnn.getVersion()
      self.err = None
      if (self.dilate > 1 and version < 6000) or (
          self.groups > 1 and version < 7000
      ):
          self.err = ValueError
      elif ndim > 2 and self.dilate > 1:
          self.err = libcudnn.CuDNNError
      _workspace_size = cudnn.get_max_workspace_size()
      cudnn.set_max_workspace_size(self.max_workspace_size)
      yield
      cudnn.set_max_workspace_size(_workspace_size)
  
imports: import sys
  import numpy
  import pytest
  import cupy
  import cupy.cuda.cudnn
  from cupy import testing
label_desc: Use image node_id 1 for calling the TestConvolutionForward obj's underlying member method code with example usage: obj.setUp() without return types