parameters: (x, data_format)
return_statement: return x, tf_data_format
docstring: Transpose and cast the input before the conv1d.
  
    Arguments:
        x: input tensor.
        data_format: string, `"channels_last"` or `"channels_first"`.
  
    Returns:
        A tensor.
docstring_summary: Transpose and cast the input before the conv1d.
docstring_tokens: Transpose and cast the input before the conv1d .
function: def _preprocess_conv1d_input(x, data_format):
    """Transpose and cast the input before the conv1d.
  
    Arguments:
        x: input tensor.
        data_format: string, `"channels_last"` or `"channels_first"`.
  
    Returns:
        A tensor.
    """
    tf_data_format = 'NWC'  # to pass TF Conv2dNative operations
    if data_format == 'channels_first':
      if not _has_nchw_support():
        x = array_ops.transpose(x, (0, 2, 1))  # NCW -> NWC
      else:
        tf_data_format = 'NCW'
    return x, tf_data_format
function_tokens: def _preprocess_conv1d_input ( x , data_format ) : tf_data_format = 'NWC' # to pass TF Conv2dNative operations if data_format == 'channels_first' : if not _has_nchw_support ( ) : x = array_ops . transpose ( x , ( 0 , 2 , 1 ) ) # NCW -> NWC else : tf_data_format = 'NCW' return x , tf_data_format