microsoft/onnxruntime-extensions

Public

mirrored from https://github.com/microsoft/onnxruntime-extensionsAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
rel-0.5

Branches

Tags

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

Clone

HTTPS

Download ZIP

operators/text/masked_fill.hpp

24lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4#pragma once
5
6#include "ocos.h"
7#include "string_utils.h"
8#include <unordered_map>
9
10struct KernelMaskedFill : BaseKernel {
11 KernelMaskedFill(OrtApi api, const OrtKernelInfo* info);
12 void Compute(OrtKernelContext* context);
13 private:
14 std::unordered_map<std::string, std::string> map_;
15};
16
17struct CustomOpMaskedFill : Ort::CustomOpBase<CustomOpMaskedFill, KernelMaskedFill> {
18 void* CreateKernel(OrtApi api, const OrtKernelInfo* info) const;
19 const char* GetName() const;
20 size_t GetInputTypeCount() const;
21 ONNXTensorElementDataType GetInputType(size_t index) const;
22 size_t GetOutputTypeCount() const;
23 ONNXTensorElementDataType GetOutputType(size_t index) const;
24};
25