获取Tensor的数据地址
template<class T> const T *GetData() const
template<class T> T *GetData()
参数 |
输入/输出 |
说明 |
---|---|---|
T |
输入 |
数据类型 |
数据地址
无。
Tensor tensor{{{8, 3, 224, 224}, {16, 3, 224, 224}}, // shape {ge::FORMAT_ND, ge::FORMAT_FRACTAL_NZ, {}}, // format kFollowing, // placement ge::DT_FLOAT16, //dt nullptr}; auto addr = tensor.GetData<int64_t>(); // reinterpret_cast<int64_t *>(&tensor + 1)