---
title: 函数：create_handle_for_gemv_ex
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/aclpythondevg_01_0803.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/aclpythondevg_01_0803.html
indexId: da97e484e4896a25a1bc796c52024915c8809893b2da15cb55cfd686f879edd675
---
# 函数：create_handle_for_gemv_ex

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |


#### 功能说明

创建矩阵-向量乘的handle，输入数据、输出数据的数据类型通过入参设置。

创建handle成功后，需调用acl.op.execute_with_handle接口执行算子。


#### 函数原型

- C函数原型
  1 2 3 4 5 6 7 8 aclError aclblasCreateHandleForGemvEx(aclTransType transA, int m, int n, aclDataType dataTypeA, aclDataType dataTypeX, aclDataType dataTypeY, aclComputeType type, aclopHandle **handle)

- python函数
  1 handle, ret = acl.blas.create_handle_for_gemv_ex(trans_a, m, n, data_type_a, data_type_x, data_type_y, type)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| trans\_a | int，矩阵A是否转置的标记。 |
| m | int，矩阵A的行数，存储矩阵乘数据时，行优先。 |
| n | int，矩阵A的列数。 |
| data\_type\_a | int，矩阵A的数据类型。 |
| data\_type\_x | int，向量x的数据类型。 |
| data\_type\_y | int，向量y的数据类型。 |
| type | int，计算精度。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| handle | int，执行算子的handle数据的指针地址。 |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |


#### 约束说明

A、x、y的数据类型支持仅支持以下组合， α和β的数据类型与y一致。

| A的数据类型 | x的数据类型 | y的数据类型 |
| --- | --- | --- |
| aclFloat16 | aclFloat16 | aclFloat16 |
| aclFloat16 | aclFloat16 | float(float32) |
| int8\_t | int8\_t | float(float32) |
| int8\_t | int8\_t | int32\_t |
