下载
中文
注册

Utils

功能

加速库公共工具接口类。

定义

class Utils {
public:
    static std::string GetAtbVersion();
    static uint64_t GetTensorSize(const Tensor &tensor);
    static uint64_t GetTensorSize(const TensorDesc &tensorDesc);
    static uint64_t GetTensorNumel(const Tensor &tensor);
    static uint64_t GetTensorNumel(const TensorDesc &tensorDesc);
    static void QuantParamConvert(const float *src, uint64_t *dest, uint64_t itemCount);
};

成员

成员名称

描述

GetAtbVersion

返回加速库版本信息。

GetTensorSize

返回Tensor对象的数据存储大小。

GetTensorNumel

返回Tensor对象的数据个数。

QuantParamConvert

量化场景使用。float数组转成uint64数组,实现逻辑是复制float到uint64的后32位,uint64的前32位置0。

  • src:输入float数组。
  • dest:转化得到的uint64数组。
  • itemCount:数组元素个数。