code: def NCHWToNHWC(input_tensor):
      """Convert the input from NCHW format to NHWC.
  
      Args:
        input_tensor:  a 4-D tensor, or a 4-element array representing the same.
  
      Returns:
        the converted tensor or a shape array
      """
      if isinstance(input_tensor, tensor.Tensor):
          return array_ops.transpose(input_tensor, [0, 2, 3, 1])
      else:
          return [
              input_tensor[0],
              input_tensor[2],
              input_tensor[3],
              input_tensor[1],
          ]
  
imports: import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 2 for calling a global function with example usage: NCHWToNHWC(input_tensor) and returns: array_ops, list