InferTensor
Function
Default constructor
Format
InferTensor() = default; InferTensor(std::string name, InferDataType dataType, std::vector<int64_t> dataShape); InferTensor(const InferTensor &other) = delete;
Parameters
Parameter |
Mandatory/Optional |
Description |
Value |
|---|---|---|---|
name |
Mandatory |
Tensor name. |
Valid string type |
dataType |
Mandatory |
Tensor data type |
Valid data type. For details, see InferDataType. |
dataShape |
Mandatory |
Tensor data shape |
Valid data shape, which must be of the std::vector<int64_t> type. |
Usage Example
Construct a tensor object whose name is INPUT_IDS, data type is INT64, and data shape is {1, 2}.
1 2 3 4 5 | auto runtimeTensor = std::make_shared<mindie_llm::InferTensor>(); 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); |
Return Value
InferTensor object
Parent topic: InferTensor