获取张量对象数据类型。
InferDataType GetDataType() const
无。
构造一个名为"INPUT_IDS",数据类型为INT64,数据维度为{1,2}的Tensor对象,然后获取对象数据类型。
1 2 3 4 5 | std::string name = "INPUT_IDS"; mindie_llm::InferDataType dataType = mindie_llm::InferDataType::TYPE_INT64; std::vector<int64_t> dataShape = {1, 2}; auto inputsTensor = std::make_shared<mindie_llm::InferTensor>(name, dataType, dataShape); mindie_llm::InferDataType dataType2 = inputsTensor->GetDataType(); |
张量对象数据类型,类型为InferDataType。