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。