parameters: (dtype)
return_statement: return new_dtype
docstring: Returns the TFRecords allowed type corresponding to dtype.
docstring_summary: Returns the TFRecords allowed type corresponding to dtype.
docstring_tokens: Returns the TFRecords allowed type corresponding to dtype .
function: def base_type(dtype):
      """Returns the TFRecords allowed type corresponding to dtype."""
      int_types = [
          tf.int8,
          tf.int16,
          tf.int32,
          tf.int64,
          tf.uint8,
          tf.uint16,
          tf.uint32,
          tf.uint64,
          tf.qint8,
          tf.qint16,
          tf.qint32,
          tf.bool,
      ]
      float_types = [tf.float16, tf.float32, tf.float64]
      byte_types = [tf.string, bytes]
  
      if dtype in int_types:
          new_dtype = tf.int64
      elif dtype in float_types:
          new_dtype = tf.float32
      elif dtype in byte_types:
          new_dtype = tf.string
      else:
          raise ValueError(f"dtype {dtype} is not a recognized/supported type!")
  
      return new_dtype
function_tokens: def base_type ( dtype ) : int_types = [ tf . int8 , tf . int16 , tf . int32 , tf . int64 , tf . uint8 , tf . uint16 , tf . uint32 , tf . uint64 , tf . qint8 , tf . qint16 , tf . qint32 , tf . bool , ] float_types = [ tf . float16 , tf . float32 , tf . float64 ] byte_types = [ tf . string , bytes ] if dtype in int_types : new_dtype = tf . int64 elif dtype in float_types : new_dtype = tf . float32 elif dtype in byte_types : new_dtype = tf . string else : raise ValueError ( f"dtype {dtype} is not a recognized/supported type!" ) return new_dtype