code: def _convolve1d2o(in1, in2, mode):
      val = _valfrommode(mode)
  
      # Promote inputs
      promType = cp.promote_types(in1.dtype, in2.dtype)
      in1 = in1.astype(promType)
      in2 = in2.astype(promType)
  
      # Create empty array to hold number of aout dimensions
      out_dimens = np.empty(in1.ndim, int)
      if val == VALID:
          for i in range(in1.ndim):
              out_dimens[i] = in1.shape[i] - in2.shape[i] + 1
              if out_dimens[i] < 0:
                  raise Exception(
                      "no part of the output is valid, use option 1 (same) or 2 \
                       (full) for third argument"
                  )
  
      # Create empty array out on GPU
      out = cp.empty(out_dimens.tolist(), in1.dtype)
  
      out = _convolve1d2o_gpu(
          in1,
          out,
          in2,
          val,
      )
  
      return out
  
imports: import cupy
  import numpy
  from ..utils._caches import _cupy_kernel_cache
  from ..utils.helper_tools import _get_function, _get_tpb_bpg, _print_atts
  from .convolution_utils import CIRCULAR, FULL, PAD, REFLECT, SAME, VALID, _bvalfromboundary, _iDivUp, _valfrommode
label_desc: Use image node_id 8 for calling a global function with example usage: _convolve1d2o(in1, in2, mode) and returns: out