microsoft/onnxruntime-extensions
Publicmirrored from https://github.com/microsoft/onnxruntime-extensionsAvailable
operators/string_tensor.h
23lines · 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 | | |
| 6 | #include <string> | |
c891e5d7Wenbing Li5 years ago | 7 | #include "ustring.h" |
| 8 | #include "ocos.h" | |
d48d825aXavier Dupré5 years ago | 9 | |
37598fefMojimi5 years ago | 10 | |
d48d825aXavier Dupré5 years ago | 11 | // Retrieves a vector of strings if the input type is std::string. |
| 12 | // It is a copy of the input data and can be modified to compute the output. | |
d1c65748Xavier Dupré5 years ago | 13 | void GetTensorMutableDataString(const OrtApi& api, Ort::CustomOpApi& ort, OrtKernelContext* context, |
d48d825aXavier Dupré5 years ago | 14 | const OrtValue* value, std::vector<std::string>& output); |
| 15 | | |
37598fefMojimi5 years ago | 16 | void GetTensorMutableDataString(const OrtApi& api, Ort::CustomOpApi& ort, OrtKernelContext* context, |
| 17 | const OrtValue* value, std::vector<ustring>& output); | |
| 18 | | |
d1c65748Xavier Dupré5 years ago | 19 | void FillTensorDataString(const OrtApi& api, Ort::CustomOpApi& ort, OrtKernelContext* context, |
d48d825aXavier Dupré5 years ago | 20 | const std::vector<std::string>& value, OrtValue* output); |
37598fefMojimi5 years ago | 21 | |
| 22 | void FillTensorDataString(const OrtApi& api, Ort::CustomOpApi& ort, OrtKernelContext* context, | |
| 23 | const std::vector<ustring>& value, OrtValue* output); |