昇腾社区首页
中文
注册

AscendVectorTransform

API定义

explicit AscendVectorTransform(int dimIn = 0, int dimOut = 0, AscendVectorTransformConfig config = AscendVectorTransformConfig()

功能描述

AscendVectorTransform的构造函数,生成AscendVectorTransform,此时根据“config”中配置的值设置NPU侧芯片资源。

输入

int dimIn:输入的线性变换的维度。

int dimOut:输出的线性变换的维度。

AscendVectorTransformConfig config = AscendVectorTransformConfig():NPU上的线性变换的资源配置。

输出

返回值

约束说明

dinIn∈{32, 64, 128, 256, 384, 512, 1024}

dinOut∈{32, 64, 128, 256, 384, 512, 1024}

考虑到前向兼容问题,“dimIn”“dimOut”与Faiss保持一致,保留默认值 0,在程序运行阶段不支持维度为 0 的情况。此外,AscendVectorTransform 继承了Faiss的纯虚函数 apply_noalloc,无法直接实例化。