code: def testConv1DTransposeSingleStrideNCW(self):
      # `NCW` data format is only supported for CUDA device.
      if test.is_gpu_available(cuda_only=True):
          with self.session():
              strides = [1, 1, 1]
  
              # Input, output: [batch, depth, width]
              x_shape = [2, 3, 4]
              y_shape = [2, 2, 4]
  
              # Filter: [kernel_width, output_depth, input_depth]
              f_shape = [3, 2, 3]
  
              x = constant_op.constant(
                  1.0, shape=x_shape, name="x", dtype=dtypes.float32
              )
              f = constant_op.constant(
                  1.0,
                  shape=f_shape,
                  name="filter",
                  dtype=dtypes.float32,
              )
  
              output = nn_ops.conv1d_transpose(
                  x,
                  f,
                  y_shape,
                  strides=strides,
                  padding="SAME",
                  data_format="NCW",
              )
  
              value = self.evaluate(output)
              for n in range(x_shape[0]):
                  for k in range(f_shape[1]):
                      for w in range(y_shape[2]):
                          target = 2 * 3.0
                          w_in = w > 0 and w < y_shape[2] - 1
                          if w_in:
                              target += 3.0
                          self.assertAllClose(target, value[n, k, w])
  
file_path: tensorflow/tensorflow/python/kernel_tests/nn_ops/conv1d_transpose_test.py
imports: import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import nn_ops
  import tensorflow.python.ops.nn_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the Conv1DTransposeTest obj's underlying member method code with example usage: obj.testConv1DTransposeSingleStrideNCW() without return types