code: def optimizer_3d(
      self,
      input_shapes,
      direction,
      include_tags,
      exclude_tags,
      op,
      border_mode="valid",
      subsample=(1, 1, 1),
      filter_dilation=(1, 1, 1),
      num_groups=1,
      optimiser=None,
  ):
      inp1 = theano.shared(
          np.random.random(input_shapes[0]).astype(theano.config.floatX)
      )
      inp2 = theano.shared(
          np.random.random(input_shapes[1]).astype(theano.config.floatX)
      )
  
      if op is None:
          inp1 = basic_ops.as_gpuarray_variable(inp1, None)
          inp2 = basic_ops.as_gpuarray_variable(inp2, None)
      if direction == 0:
          conv_op = abstract_conv.AbstractConv3d(
              input_shapes[0],
              input_shapes[1],
              border_mode=border_mode,
              subsample=subsample,
              filter_dilation=filter_dilation,
              num_groups=num_groups,
          )(inp1, inp2)
  
      if direction == 1:
          conv_op = abstract_conv.AbstractConv3d_gradWeights(
              input_shapes[0],
              input_shapes[2],
              border_mode=border_mode,
              subsample=subsample,
              filter_dilation=filter_dilation,
              num_groups=num_groups,
          )(inp1, inp2, input_shapes[2][-3:])
  
      if direction == 2:
          conv_op = abstract_conv.AbstractConv3d_gradInputs(
              input_shapes[2],
              input_shapes[1],
              border_mode=border_mode,
              subsample=subsample,
              filter_dilation=filter_dilation,
              num_groups=num_groups,
          )(inp2, inp1, input_shapes[2][-3:])
  
      theano.config.metaopt.optimizer_including = include_tags
      theano.config.metaopt.optimizer_excluding = exclude_tags
      mode = (
          mode_with_gpu.including("conv_meta")
          .excluding("conv_dnn")
          .excluding("conv_gemm")
      )
  
      # All meta optimizer compile a new function. This need to know
      # the current linker, but this information is not available,
      # so it use the default mode.
      if op is None:
          # No convolutions optimization takes place
          assert optimiser.transform(conv_op.owner) is None
          return
      elif op != "conv3d2d":
          with theano.change_flags(mode=mode):
              conv_func = theano.function([], conv_op, mode=mode)
          assert any(
              [
                  isinstance(node.op, op)
                  for node in conv_func.maker.fgraph.toposort()
              ]
          )
      else:
          with theano.change_flags(mode=mode):
              conv_func = theano.function(
                  [], conv_op, mode=mode_with_gpu.including("conv_meta")
              )
      ref_func = theano.function([], conv_op, mode=mode_with_gpu)
      utt.assert_allclose(conv_func(), ref_func())
  
imports: from __future__ import absolute_import, print_function, division
  from nose.tools import assert_raises
  import numpy
  import theano
  from theano import tensor
  import theano.tensor.slinalg
  from theano.tests.breakpoint import PdbBreakpoint
  from theano.tests import unittest_tools, test_ifelse
  from theano.tensor.tests import test_basic
  from theano.gof.opt import check_stack_trace
  import theano.gpuarray
  from ..None import basic_ops
  from ..type import GpuArrayType, gpuarray_shared_constructor, get_context
  from ..basic_ops import GpuAlloc, GpuAllocEmpty, GpuReshape, GpuFromHost, HostFromGpu, host_from_gpu
  from ..blas import GpuGemm
  from ..elemwise import GpuCAReduceCuda, GpuCAReduceCPY, GpuElemwise, Elemwise, max_inputs_to_GpuElemwise
  from ..dnn import GpuDnnReduction
  from ..subtensor import GpuSubtensor
  from ..linalg import GpuCusolverSolve, cusolver_available, GpuCholesky
  from .config import mode_with_gpu, mode_without_gpu, test_ctx_name, SkipTest
  import unittest
  from theano.tensor.nnet import abstract_conv
  from theano.gpuarray import dnn, blas, opt
label_desc: Use image node_id 2 for calling the Conv_opt_test obj's underlying member method code with example usage: obj.optimizer_3d(input_shapes, direction, include_tags, exclude_tags, op, border_mode, subsample, filter_dilation, num_groups, optimiser) without return types