2023-10-19 20:40:58 +03:00
|
|
|
#include "text/string_functions.h"
|
2021-09-02 21:19:18 +03:00
|
|
|
#include "text/op_ragged_tensor.hpp"
|
|
|
|
#include "text/string_to_vector.hpp"
|
|
|
|
#include "text/vector_to_string.hpp"
|
|
|
|
#include "text/string_ecmaregex_replace.hpp"
|
|
|
|
#include "text/string_ecmaregex_split.hpp"
|
2021-09-14 04:13:08 +03:00
|
|
|
#include "text/string_mapping.hpp"
|
2021-09-02 21:19:18 +03:00
|
|
|
|
|
|
|
#if defined(ENABLE_RE2_REGEX)
|
2023-10-19 20:40:58 +03:00
|
|
|
#include "text/re2_strings/string_regex.h"
|
2023-05-30 23:52:59 +03:00
|
|
|
#endif // ENABLE_RE2_REGEX
|
2021-09-02 21:19:18 +03:00
|
|
|
|
2023-10-19 20:40:58 +03:00
|
|
|
|
|
|
|
FxLoadCustomOpFactory LoadCustomOpClasses_Text = []()-> CustomOpArray& {
|
2023-05-31 04:04:44 +03:00
|
|
|
static OrtOpLoader op_loader(
|
2021-09-02 21:19:18 +03:00
|
|
|
#if defined(ENABLE_RE2_REGEX)
|
2023-10-19 20:40:58 +03:00
|
|
|
CustomCpuStructV2("StringRegexReplace", KernelStringRegexReplace),
|
|
|
|
CustomCpuFuncV2("StringRegexSplitWithOffsets", KernelStringRegexSplitWithOffsets),
|
2023-05-30 23:52:59 +03:00
|
|
|
#endif // ENABLE_RE2_REGEX
|
2023-10-19 20:40:58 +03:00
|
|
|
CustomCpuFuncV2("RaggedTensorToSparse", RaggedTensorToSparse),
|
|
|
|
CustomCpuStructV2("RaggedTensorToDense", KernelRaggedTensoroDense),
|
|
|
|
CustomCpuFuncV2("StringRaggedTensorToDense", StringRaggedTensorToDense),
|
|
|
|
CustomCpuFuncV2("StringEqual", string_equal),
|
|
|
|
CustomCpuFuncV2("StringToHashBucket", string_hash),
|
|
|
|
CustomCpuFuncV2("StringToHashBucketFast", string_hash_fast),
|
|
|
|
CustomCpuFuncV2("StringJoin", string_join),
|
|
|
|
CustomCpuFuncV2("StringLower", string_lower),
|
|
|
|
CustomCpuFuncV2("StringUpper", string_upper),
|
|
|
|
CustomCpuFuncV2("MaskedFill", masked_fill),
|
|
|
|
CustomCpuFuncV2("StringSplit", string_split),
|
|
|
|
CustomCpuFuncV2("StringStrip", string_strip),
|
|
|
|
CustomCpuFuncV2("StringLength", string_length),
|
|
|
|
CustomCpuFuncV2("StringConcat", string_concat),
|
|
|
|
CustomCpuStructV2("StringMapping", KernelStringMapping),
|
|
|
|
CustomCpuStructV2("StringToVector", KernelStringToVector),
|
|
|
|
CustomCpuStructV2("VectorToString", KernelVectorToString),
|
|
|
|
CustomCpuStructV2("StringECMARegexReplace", KernelStringECMARegexReplace),
|
|
|
|
CustomCpuStructV2("StringECMARegexSplitWithOffsets", KernelStringECMARegexSplitWithOffsets));
|
2023-05-31 04:04:44 +03:00
|
|
|
|
2023-10-19 20:40:58 +03:00
|
|
|
return op_loader.GetCustomOps();
|
|
|
|
};
|