code: def _T_force_NHWC(T):
      """Modify T to accomdate different data types
  
      [N, C, H, W]  ->  [N, H, W, C]
      [N, C]        ->  [N, 1, 1, C]
  
      """
  
      def T2(name):
          t = T(name)
          shape = t.shape
          if str(shape) == "<unknown>":
              return t
          if len(shape) == 2:
              return t[:, None, None, :]
          elif len(shape) == 4:
              fmt = property_inference.infer_data_format(t)
              if fmt == "NCHW":
                  return tf.transpose(t, [0, 2, 3, 1])
          return t
  
      return T2
  
file_path: lucid/lucid/optvis/objectives_util.py
imports: from __future__ import absolute_import, division, print_function
  from decorator import decorator
  import numpy
  import tensorflow
  import lucid.misc.graph_analysis.property_inference
label_desc: Use image node_id 5 for calling a global function with example usage: _T_force_NHWC(T) and returns: T2, t, t, t, tf