根据Name删除Tensor。
Status DelTensorByName(const std::string &name)
参数 |
是否必选 |
说明 |
取值要求 |
---|---|---|---|
name |
是 |
tensor名字。 |
合法的string类型。 |
构造一个请求对象,从请求中删除名字为“INPUT_IDS”的Tensor对象。
1 2 3 4 5 6 7 8 9 | mindie_llm::InferRequestId runtimeReqId(0); std::shared_ptr<mindie_llm::InferRequest> runtimeRequest(runtimeReqId); 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); runtimeRequest->AddTensor(name, inputsTensor); TensorPtr tensor = std::make_shared<mindie_llm::InferTensor>(); Status ret = request->DelTensorByName("INPUT_IDS"); |
Status对象。