code: def test_elemwise_pow():
      # Test that GpuElemwise(pow) can compile with any combination of integer
      # or float input dtype.
      dtypes = [
          "uint8",
          "uint16",
          "uint32",
          "uint64",
          "int8",
          "int16",
          "int32",
          "int64",
          "float16",
          "float32",
          "float64",
      ]
  
      for dtype_base in dtypes:
          for dtype_exp in dtypes:
              # Compile a gpu function with the specified dtypes
              base_val = np.random.randint(0, 5, size=10).astype(
                  dtype_base
              )
              exp_val = np.random.randint(0, 3, size=10).astype(
                  dtype_exp
              )
  
              base = theano.tensor.vector(dtype=dtype_base)
              exp = gpuarray_shared_constructor(exp_val)
              assert exp.dtype == dtype_exp
              output = base**exp
              f = theano.function([base], output, mode=mode_with_gpu)
              # We don't transfer to the GPU when the output dtype is int*
              n = len(
                  [
                      n
                      for n in f.maker.fgraph.apply_nodes
                      if isinstance(n.op, GpuElemwise)
                  ]
              )
              assert n == (output.dtype in tensor.float_dtypes)
  
              # Call the function to make sure the output is valid
              out = f(base_val)
              expected_out = base_val**exp_val
              assert_allclose(out, expected_out)
  
imports: from __future__ import absolute_import, print_function, division
  from copy import copy
  from unittest import TestCase
  import numpy
  import theano
  from theano import scalar, gof, tensor
  from theano.compile import DebugMode, Mode
  from theano.tests.unittest_tools import SkipTest, assert_allclose
  from theano.tensor.tests import test_elemwise
  from .config import mode_with_gpu, mode_without_gpu, test_ctx_name
  from .test_basic_ops import rand_gpuarray
  from ..elemwise import GpuElemwise, GpuDimShuffle, GpuCAReduceCuda, GpuCAReduceCPY, GpuErfinv, GpuErfcinv
  from ..dnn import GpuDnnReduction
  from ..type import GpuArrayType, get_context, gpuarray_shared_constructor
  from pygpu import ndgpuarray
label_desc: Use image node_id 1 for calling a global function with example usage: test_elemwise_pow() without return types