parameters: (x, data_format, force_transpose=False)
return_statement: return x, tf_data_format
docstring: Transpose and cast the input before the conv2d.
  
    Arguments:
        x: input tensor.
        data_format: string, `"channels_last"` or `"channels_first"`.
        force_transpose: Boolean. If True, the input will always be transposed
            from NCHW to NHWC if `data_format` is `"channels_first"`.
            If False, the transposition only occurs on CPU (GPU ops are
            assumed to support NCHW).
  
    Returns:
        A tensor.
docstring_summary: Transpose and cast the input before the conv2d.
docstring_tokens: Transpose and cast the input before the conv2d .
function: def _preprocess_conv2d_input(x, data_format, force_transpose=False):
    """Transpose and cast the input before the conv2d.
  
    Arguments:
        x: input tensor.
        data_format: string, `"channels_last"` or `"channels_first"`.
        force_transpose: Boolean. If True, the input will always be transposed
            from NCHW to NHWC if `data_format` is `"channels_first"`.
            If False, the transposition only occurs on CPU (GPU ops are
            assumed to support NCHW).
  
    Returns:
        A tensor.
    """
    tf_data_format = 'NHWC'
    if data_format == 'channels_first':
      if not _has_nchw_support() or force_transpose:
        x = array_ops.transpose(x, (0, 2, 3, 1))  # NCHW -> NHWC
      else:
        tf_data_format = 'NCHW'
    return x, tf_data_format
function_tokens: def _preprocess_conv2d_input ( x , data_format , force_transpose = False ) : tf_data_format = 'NHWC' if data_format == 'channels_first' : if not _has_nchw_support ( ) or force_transpose : x = array_ops . transpose ( x , ( 0 , 2 , 3 , 1 ) ) # NCHW -> NHWC else : tf_data_format = 'NCHW' return x , tf_data_format