code: def _SetupValuesForDevice(
      self,
      tensor_in_sizes,
      filter_in_sizes,
      stride,
      padding,
      data_format,
      dtype,
      use_gpu,
      op_name,
  ):
      total_size_tensor = np.prod(tensor_in_sizes)
      total_size_filter = np.prod(filter_in_sizes)
  
      # Initializes the input tensor with array containing numbers from 0 to 1.
      # We keep the input tensor values fairly small to avoid overflowing float16
      # during the conv3d.
      x1 = [
          f * 1.0 / total_size_tensor
          for f in range(1, total_size_tensor + 1)
      ]
      x2 = [
          f * 1.0 / total_size_filter
          for f in range(1, total_size_filter + 1)
      ]
      with self.cached_session(use_gpu=use_gpu):
          t1 = constant_op.constant(
              x1, shape=tensor_in_sizes, dtype=dtype
          )
          t2 = constant_op.constant(
              x2, shape=filter_in_sizes, dtype=dtype
          )
  
          if isinstance(stride, collections_abc.Iterable):
              strides = [1] + list(stride) + [1]
          else:
              strides = [1, stride, stride, stride, 1]
  
          if data_format == "NCDHW":
              t1 = test_util.NHWCToNCHW(t1)
              strides = test_util.NHWCToNCHW(strides)
  
          if op_name == "Conv3D":
              op = nn_ops.conv3d
              conv_format = data_format
          elif op_name == "Conv":
              op = gen_nn_ops.conv
              conv_format = (
                  "CHANNELS_LAST"
                  if data_format == "NDHWC"
                  else "CHANNELS_FIRST"
              )
          else:
              raise ValueError("Invalid op name: %s" % op_name)
          conv = op(
              t1, t2, strides, padding=padding, data_format=conv_format
          )
          if data_format == "NCDHW":
              conv = test_util.NCHWToNHWC(conv)
  
          return conv
  
imports: import math
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import nn_ops
  import tensorflow.python.ops.nn_grad
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util.compat import collections_abc
  from tensorflow.python.eager import context
label_desc: Use image node_id 1 for calling the Conv3DTest obj's underlying member method code with example usage: obj._SetupValuesForDevice(tensor_in_sizes, filter_in_sizes, stride, padding, data_format, dtype, use_gpu, op_name) and returns: conv