pypto.experimental.gather_in_l1#
产品支持情况#
产品 |
是否支持 |
|---|---|
Ascend 950PR/Ascend 950DT |
√ |
Atlas A3 训练系列产品/Atlas A3 推理系列产品 |
√ |
Atlas A2 训练系列产品/Atlas A2 推理系列产品 |
√ |
功能说明#
该接口为定制接口,约束较多。不保证稳定性。
从GM上的Tensor离散搬运指定行的数据,同时每行搬运前size个数据至L1。
函数原型#
gather_in_l1(src: Tensor, indices: Tensor, block_table: Tensor, block_size: int,
size: int, is_b_matrix: bool, is_trans: bool) -> Tensor
参数说明
参数名 |
输入/输出 |
说明 |
|---|---|---|
src |
输入 |
源操作数。 |
indices |
输入 |
源操作数的行偏移。 |
block_table |
输入 |
源操作数。 |
block_size |
输入 |
源操作数。 |
size |
输入 |
每行搬运的数据数。 |
is_b_matrix |
输入 |
搬运后的结果,即输出Tensor是否作为matmul的B矩阵。 |
is_trans |
输入 |
搬运后的结果,即输出Tensor是否转置。 |
返回值说明#
返回输出Tensor
调用示例#
src = pypto.tensor([16, 32], pypto.DT_FP32, "tensor_src")
offset = pypto.tensor([1, 32], pypto.DT_INT32, "tensor_offset")
out = pypto.experimental.gather_in_l1(src , offset, 20, false, false)