1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
// Copyright (c) Facebook Inc. and Microsoft Corporation.
// Licensed under the MIT license.
#include "./schema.h"
namespace ONNX_NAMESPACE {
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables,bugprone-branch-clone)
ONNX_PYTORCH_OPERATOR_SET_SCHEMA(
SparseLengthsSumFused8BitRowwise,
1,
OpSchema()
.SetDoc("Mirror Caffe2 SparseLengthsSumFused8BitRowwise operator")
.Input(0, "DATA", "data tensor", "T1")
.Input(1, "INDICES", "indices tensor", "T2")
.Input(2, "LENGTHS", "lengths tensor", "T2")
.Output(0, "output", "Output tensor", "T2")
.TypeConstraint(
"T1",
{"tensor(uint8)"},
"Constrain input data to uint8 tensors.")
.TypeConstraint(
"T2",
{"tensor(int8)",
"tensor(int16)",
"tensor(int32)",
"tensor(int64)",
"tensor(uint8)",
"tensor(uint16)",
"tensor(uint32)",
"tensor(uint64)"},
"Constrain index and length to integral tensors."));
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables,bugprone-branch-clone)
ONNX_PYTORCH_OPERATOR_SET_SCHEMA(
SparseLengthsSum,
1,
OpSchema()
.SetDoc("Mirror Caffe2 SparseLengthsSum operator")
.Input(0, "DATA", "data tensor", "T1")
.Input(1, "INDICES", "indices tensor", "T2")
.Input(2, "LENGTHS", "lengths tensor", "T2")
.Output(0, "output", "Output tensor", "T1")
.TypeConstraint(
"T1",
{"tensor(float16)", "tensor(float)", "tensor(double)"},
"Constrain input and output types to float tensors.")
.TypeConstraint(
"T2",
{"tensor(int8)",
"tensor(int16)",
"tensor(int32)",
"tensor(int64)",
"tensor(uint8)",
"tensor(uint16)",
"tensor(uint32)",
"tensor(uint64)"},
"Constrain index and length to integral tensors."));
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables,bugprone-branch-clone)
ONNX_PYTORCH_OPERATOR_SET_SCHEMA(
SparseLengthsWeightedSum,
1,
OpSchema()
.SetDoc("Mirror Caffe2 SparseLengthsWeightedSum operator")
.Input(0, "DATA", "data tensor", "T1")
.Input(1, "WEIGHTS", "data tensor", "T1")
.Input(2, "INDICES", "indices tensor", "T2")
.Input(3, "LENGTHS", "lengths tensor", "T2")
.Output(0, "output", "Output tensor", "T1")
.TypeConstraint(
"T1",
{"tensor(float16)", "tensor(float)", "tensor(double)"},
"Constrain input and output types to float tensors.")
.TypeConstraint(
"T2",
{"tensor(int8)",
"tensor(int16)",
"tensor(int32)",
"tensor(int64)",
"tensor(uint8)",
"tensor(uint16)",
"tensor(uint32)",
"tensor(uint64)"},
"Constrain index and length to integral tensors."));
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables,bugprone-branch-clone)
ONNX_PYTORCH_OPERATOR_SET_SCHEMA(
BatchGather,
1,
OpSchema()
.SetDoc("Mirror Caffe2 BatchGather operator")
.Input(0, "DATA", "data tensor", "T1")
.Input(1, "INDICES", "indices tensor", "T2")
.Output(0, "output", "Output tensor", "T1")
.TypeConstraint(
"T1",
{"tensor(float16)", "tensor(float)", "tensor(double)"},
"Constrain input and output types to float tensors.")
.TypeConstraint(
"T2",
{"tensor(int8)",
"tensor(int16)",
"tensor(int32)",
"tensor(int64)",
"tensor(uint8)",
"tensor(uint16)",
"tensor(uint32)",
"tensor(uint64)"},
"Constrain index and length to integral tensors."));
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables,bugprone-branch-clone)
ONNX_PYTORCH_OPERATOR_SET_SCHEMA(
DotProduct,
1,
OpSchema()
.SetDoc("Mirror Caffe2 DotProduct operator")
.Input(0, "X", "Input 1 tensor", "T")
.Input(1, "Y", "Input 2 tensor", "T")
.Output(0, "Z", "Output tensor", "T")
.TypeConstraint(
"T",
{"tensor(float16)", "tensor(float)", "tensor(double)"},
"Constrain input and output types to float tensors."));
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables,bugprone-branch-clone)
ONNX_PYTORCH_OPERATOR_SET_SCHEMA(
FCTransposed,
1,
OpSchema()
.SetDoc("Mirror Caffe2 FCTransposed operator")
.Input(0, "X", "Input tensor", "T")
.Input(1, "W", "Weight tensor", "T")
.Input(2, "B", "Bias tensor", "T")
.Output(0, "Z", "Output tensor", "T")
.TypeConstraint(
"T",
{"tensor(float16)", "tensor(float)", "tensor(double)"},
"Constrain input and output types to float tensors."));
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables,bugprone-branch-clone)
ONNX_PYTORCH_OPERATOR_SET_SCHEMA(
BatchMatMul,
1,
OpSchema()
.SetDoc("Mirror Caffe2 BatchMatMul operator")
.Input(0, "X", "tensor of shape (dim0, dim1 ... M, K)", "T")
.Input(1, "Y", "tensor of shape (dim0, dim2 ... K, N)", "T")
.Output(0, "Z", "tensor of shape (dim0, dim1 ... M, N)", "T")
.TypeConstraint(
"T",
{"tensor(float16)", "tensor(float)", "tensor(double)"},
"Constrain input and output types to float tensors."));
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables,bugprone-branch-clone)
ONNX_PYTORCH_OPERATOR_SET_SCHEMA(
ExpandDims,
1,
OpSchema()
.SetDoc("Mirror Caffe2 ExpandDims operator")
.Input(0, "X", "Input tensor", "T")
.Output(0, "Y", "Output tensor", "T")
.TypeConstraint(
"T",
{"tensor(float16)", "tensor(float)", "tensor(double)"},
"Constrain input and output types to float tensors."));
} // namespace ONNX_NAMESPACE
|