code: def testConvertDataFormat(self):
      self.assertEqual(
          "NCDHW", utils.convert_data_format("channels_first", 5)
      )
      self.assertEqual(
          "NCHW", utils.convert_data_format("channels_first", 4)
      )
      self.assertEqual(
          "NCW", utils.convert_data_format("channels_first", 3)
      )
      self.assertEqual(
          "NHWC", utils.convert_data_format("channels_last", 4)
      )
      self.assertEqual(
          "NWC", utils.convert_data_format("channels_last", 3)
      )
      self.assertEqual(
          "NDHWC", utils.convert_data_format("channels_last", 5)
      )
  
      with self.assertRaises(ValueError):
          utils.convert_data_format("invalid", 2)
  
file_path: tensorflow/tensorflow/python/layers/utils_test.py
imports: from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import test_util
  from tensorflow.python.layers import utils
  from tensorflow.python.ops import array_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the ConvUtilsTest obj's underlying member method code with example usage: obj.testConvertDataFormat() without return types