# GstMLType

Source: [https://docs.qualcomm.com/doc/80-70014-50Y/topic/ml-api-gstmltype.html](https://docs.qualcomm.com/doc/80-70014-50Y/topic/ml-api-gstmltype.html)

GstMLType 使你能够获取有关 GStreamer ML 数据类型的信息。

以下是描述张量格式的可能值：| 枚举 | 说明 |
| --- | --- |
| GST\_ML\_TYPE\_UNKNOWN | 无效数据 |
| GST\_ML\_TYPE\_INT8 | 数据表示为有符号整型值的 1 个字节 |
| GST\_ML\_TYPE\_UINT8 | 数据表示为无符号整数值的 1 个字节 |
| GST\_ML\_TYPE\_INT32 | 数据表示为有符号整数值的 4 个字节 |
| GST\_ML\_TYPE\_UINT32 | 数据表示为无符号整数值的 4 个字节 |
| GST\_ML\_TYPE\_FLOAT16 | 数据表示为 2 个字节的浮点值 |
| GST\_ML\_TYPE\_FLOAT32 | 数据表示为 4 个字节的浮点值 |

以下部分提供有关 GstMLType API 的信息。

## gst\_ml\_type\_get\_size

返回 GstMLType 的大小（以字节为单位）

**原型**

    guint
    gst_ml_type_get_size (GstMLType type)
    Copy to clipboard

**参数**

| [in] | `type` | 一个 GstMLType |
| :--- | :--- | :--- |

**返回结果**

大小（以字节为单位）。

## gst\_ml\_type\_from\_string

根据其字符串版本返回 GstMLType。

**原型**

    GstMLType
    gst_ml_type_from_string (const gchar * type)
    Copy to clipboard

**参数**

| [in] | `type` | GstMLType 的字符字符串版本 |
| :--- | :--- | :--- |

**返回结果**

一个 GstMLType

## gst\_ml\_type\_to\_string

返回 GstMLType 的字符字符串版本

    const gchar *
    gst_ml_type_to_string (GstMLType type)
    Copy to clipboard

**参数**

| [in] | `type` | GstMLType 的字符串版本 |
| :--- | :--- | :--- |

**返回结果**

GstMLType 的新字符字符串版本

**Parent Topic:** [机器学习 API](https://docs.qualcomm.com/doc/80-70014-50Y/topic/machine-learning-apis.html)

Last Published: Nov 11, 2025

[Previous Topic
机器学习 API](https://docs.qualcomm.com/bundle/publicresource/80-70014-50Y/topics/machine-learning-apis.md) [Next Topic
GstMLInfo](https://docs.qualcomm.com/bundle/publicresource/80-70014-50Y/topics/ml-api-gstmlinfo.md)