1
// Tencent is pleased to support the open source community by making ncnn available.
3
// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
5
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
6
// in compliance with the License. You may obtain a copy of the License at
8
// https://opensource.org/licenses/BSD-3-Clause
10
// Unless required by applicable law or agreed to in writing, software distributed
11
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
13
// specific language governing permissions and limitations under the License.
18
include "mlir/IR/OpBase.td"
19
include "mlir/Interfaces/SideEffectInterfaces.td"
20
include "tf_op_base.td"
22
def NCNN_Dialect : Dialect {
24
let cppNamespace = "ncnn";
27
//===----------------------------------------------------------------------===//
29
//===----------------------------------------------------------------------===//
31
class NCNN_Op<string mnemonic, list<OpTrait> traits = []> :
32
Op<NCNN_Dialect, mnemonic, traits>;
34
//===----------------------------------------------------------------------===//
36
//===----------------------------------------------------------------------===//
38
def NCNN_KerasConv2DOp : NCNN_Op<"KerasConv2D", [NoSideEffect]> {
45
I64ArrayAttr:$strides,
46
TF_AnyStrAttrOf<["SAME", "VALID", "EXPLICIT"]>:$padding,
47
DefaultValuedAttr<I64ArrayAttr, "{}">:$explicit_paddings,
48
DefaultValuedAttr<I64ArrayAttr, "{1, 1, 1, 1}">:$dilations
56
def NCNN_KerasDenseOp : NCNN_Op<"KerasDense", [NoSideEffect]> {
69
def NCNN_KerasBatchNormOp : NCNN_Op<"KerasBatchNorm", [NoSideEffect]> {
82
def NCNN_BinaryOpOp : NCNN_Op<"BinaryOp", [NoSideEffect]> {
96
def NCNN_InstanceNormOp : NCNN_Op<"InstanceNorm", [NoSideEffect]> {
108
def NCNN_InstanceNormAffineOp : NCNN_Op<"InstanceNormAffine", [NoSideEffect]> {
122
def NCNN_SwishOp : NCNN_Op<"Swish", [NoSideEffect]> {