parameters: (
      tf_type: dtypes.DType, usage: str = "")
return_statement: return tflite_type
docstring: Convert inference type from tf type to tflite type.
  
    Args:
      tf_type: TensorFlow type.
      usage: Text describing the reason for invoking this function.
  
    Raises:
      ValueError: If `tf_type` is unsupported.
  
    Returns:
      tflite_type: TFLite type. Refer to lite/toco/types.proto.
docstring_summary: Convert inference type from tf type to tflite type.
docstring_tokens: Convert inference type from tf type to tflite type .
function: def convert_inference_tf_type_to_tflite_type(
      tf_type: dtypes.DType, usage: str = "") -> _types_pb2.IODataType:
    """Convert inference type from tf type to tflite type.
  
    Args:
      tf_type: TensorFlow type.
      usage: Text describing the reason for invoking this function.
  
    Raises:
      ValueError: If `tf_type` is unsupported.
  
    Returns:
      tflite_type: TFLite type. Refer to lite/toco/types.proto.
    """
    mapping = {
        dtypes.float32: _types_pb2.FLOAT,
        dtypes.uint8: _types_pb2.QUANTIZED_UINT8,
        dtypes.int8: _types_pb2.QUANTIZED_INT8,
        dtypes.int16: _types_pb2.QUANTIZED_INT16,
    }
    tflite_type = mapping.get(tf_type)
    if tflite_type is None:
      raise ValueError("Unsupported TensorFlow type `{0}` provided for the {1}"
                       .format(tf_type, usage))
    return tflite_type
function_tokens: def convert_inference_tf_type_to_tflite_type ( tf_type : dtypes . DType , usage : str = "" ) -> _types_pb2 . IODataType : mapping = { dtypes . float32 : _types_pb2 . FLOAT , dtypes . uint8 : _types_pb2 . QUANTIZED_UINT8 , dtypes . int8 : _types_pb2 . QUANTIZED_INT8 , dtypes . int16 : _types_pb2 . QUANTIZED_INT16 , } tflite_type = mapping . get ( tf_type ) if tflite_type is None : raise ValueError ( "Unsupported TensorFlow type `{0}` provided for the {1}" . format ( tf_type , usage ) ) return tflite_type