microsoft/onnxruntime-extensions
Publicmirrored from https://github.com/microsoft/onnxruntime-extensionsAvailable
base/string_tensor.h
22lines · modeblame
d48d825aXavier Dupré5 years ago | 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT License. | |
| 3 | | |
| 4 | #pragma once | |
| 5 | | |
c891e5d7Wenbing Li5 years ago | 6 | #include "ocos.h" |
ee306deeWenbing Li3 years ago | 7 | #include <string> |
d48d825aXavier Dupré5 years ago | 8 | |
| 9 | // Retrieves a vector of strings if the input type is std::string. | |
| 10 | // It is a copy of the input data and can be modified to compute the output. | |
e448676aScott McKay2 years ago | 11 | void GetTensorMutableDataString(const OrtApi& api, const OrtW::CustomOpApi& ort, const OrtKernelContext* context, |
d48d825aXavier Dupré5 years ago | 12 | const OrtValue* value, std::vector<std::string>& output); |
e448676aScott McKay2 years ago | 13 | void FillTensorDataString(const OrtApi& api, const OrtW::CustomOpApi& ort, const OrtKernelContext* context, |
d48d825aXavier Dupré5 years ago | 14 | const std::vector<std::string>& value, OrtValue* output); |
367f59c6Wenbing Li2 years ago | 15 | |
| 16 | | |
| 17 | class ustring; | |
| 18 | void GetTensorMutableDataString(const OrtApi& api, const OrtW::CustomOpApi& ort, const OrtKernelContext* context, | |
| 19 | const OrtValue* value, std::vector<ustring>& output); | |
| 20 | | |
| 21 | void FillTensorDataString(const OrtApi& api, const OrtW::CustomOpApi& ort, const OrtKernelContext* context, | |
| 22 | const std::vector<ustring>& value, OrtValue* output); |