---
title: OpSelectFormat
description: "注册一个格式选择函数，获取数据类型和数据格式，由算子自行决定支持情况。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00715.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00715.html
indexId: fcf5f5aaf8ba16a82f199cb00058ffe8b713561b474bf4a18e91944dc3f24bb978
---
# OpSelectFormat

#### 函数功能

注册一个格式选择函数，获取数据类型和数据格式，由算子自行决定支持情况。


#### 函数原型

```
OpImplRegisterV2 &OpSelectFormat(OP_CHECK_FUNC_V2 op_select_format_func)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |  |  |
| --- | --- | --- | --- | --- |
| select\_format\_func | 输入 | 待注册的OP\_CHECK\_FUNC\_V2函数。 OP\_CHECK\_FUNC\_V2类型定义如下： 1 using OP\_CHECK\_FUNC\_V2 = ge::graphStatus (\*)(const OpCheckContext \*context, ge::AscendString &result); | 1 | using OP\_CHECK\_FUNC\_V2 = ge::graphStatus (\*)(const OpCheckContext \*context, ge::AscendString &result); |
| 1 | using OP\_CHECK\_FUNC\_V2 = ge::graphStatus (\*)(const OpCheckContext \*context, ge::AscendString &result); |  |  |  |


#### 返回值说明

返回算子的OpImplRegisterV2对象本身，该对象新增注册OP_CHECK_FUNC_V2函数。


#### 约束说明

无
