microsoft/onnxruntime-extensions

Public

mirrored fromhttps://github.com/microsoft/onnxruntime-extensionsAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
3e82549bcb53bc93d04c25d64f16a52d495725c1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

operators/text/op_equal.cc

37lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4#include "op_equal.hpp"
5#include "op_equal_impl.hpp"
6#include <string>
7
8KernelStringEqual::KernelStringEqual(OrtApi api) : BaseKernel(api) {
9}
10
11void KernelStringEqual::Compute(OrtKernelContext* context) {
12 KernelEqual_Compute<std::string>(api_, ort_, context);
13}
14
15size_t CustomOpStringEqual::GetInputTypeCount() const {
16 return 2;
17};
18
19size_t CustomOpStringEqual::GetOutputTypeCount() const {
20 return 1;
21};
22
23ONNXTensorElementDataType CustomOpStringEqual::GetOutputType(size_t /*index*/) const {
24 return ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL;
25};
26
27void* CustomOpStringEqual::CreateKernel(OrtApi api, const OrtKernelInfo* /* info */) const{
28 return new KernelStringEqual(api);
29};
30
31const char* CustomOpStringEqual::GetName() const {
32 return "StringEqual";
33};
34
35ONNXTensorElementDataType CustomOpStringEqual::GetInputType(size_t /*index*/) const {
36 return ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING;
37};