op_attrs.py 7.24 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
17 18 19 20 21
"""The attributes node used for Relay operators"""

from ...attrs import Attrs
from ..base import register_relay_attr_node

22 23 24 25 26 27

@register_relay_attr_node
class Conv1DAttrs(Attrs):
    """Attributes for nn.conv1d"""


28 29
@register_relay_attr_node
class Conv2DAttrs(Attrs):
30
    """Attributes for nn.conv2d"""
31

32 33 34

@register_relay_attr_node
class Conv2DWinogradAttrs(Attrs):
35
    """Attributes for nn.contrib_conv2d_winograd_without_weight_transform"""
36

37 38 39

@register_relay_attr_node
class Conv2DWinogradWeightTransformAttrs(Attrs):
40
    """Attributes for nn.contrib_conv2d_winograd_weight_transform"""
41

42 43

@register_relay_attr_node
hlu1 committed
44
class Conv2DWinogradNNPACKWeightTransformAttrs(Attrs):
45
    """Attributes for nn.contrib_conv2d_winograd_nnpack_weight_transform"""
hlu1 committed
46 47 48


@register_relay_attr_node
49
class GlobalPool2DAttrs(Attrs):
50 51 52 53 54 55 56 57 58 59 60 61 62 63
    """Attributes for nn.global_pool"""


@register_relay_attr_node
class BiasAddAttrs(Attrs):
    """Atttribute of nn.bias_add"""


@register_relay_attr_node
class DenseAttrs(Attrs):
    """Attributes for nn.dense"""


@register_relay_attr_node
64 65 66 67 68
class FIFOBufferAttrs(Attrs):
    """Attributes for nn.fifo_buffer"""


@register_relay_attr_node
69 70 71 72
class UpSamplingAttrs(Attrs):
    """Attributes for nn.upsampling"""

@register_relay_attr_node
73 74 75 76
class UpSampling3DAttrs(Attrs):
    """Attributes for nn.upsampling3d"""

@register_relay_attr_node
77 78 79
class PadAttrs(Attrs):
    """Attributes for nn.pad"""

80 81 82
@register_relay_attr_node
class MirrorPadAttrs(Attrs):
    """Attributes for nn.mirror_pad"""
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

@register_relay_attr_node
class LeakyReluAttrs(Attrs):
    """Attributes for nn.leaky_relu"""


@register_relay_attr_node
class PReluAttrs(Attrs):
    """Attributes for nn.prelu"""


@register_relay_attr_node
class DropoutAttrs(Attrs):
    """Attributes for nn.dropout"""


@register_relay_attr_node
class BatchNormAttrs(Attrs):
    """Attributes for nn.batch_norm"""


@register_relay_attr_node
class LRNAttrs(Attrs):
    """Attributes for nn.lrn"""


@register_relay_attr_node
class L2NormalizeAttrs(Attrs):
    """Attributes for nn.l2_normalize"""


@register_relay_attr_node
class DeformableConv2DAttrs(Attrs):
    """Attributes for nn.deformable_conv2d"""


@register_relay_attr_node
class ResizeAttrs(Attrs):
    """Attributes for image.resize"""

123 124 125
@register_relay_attr_node
class CropAndResizeAttrs(Attrs):
    """Attributes for image.crop_and_resize"""
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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274

@register_relay_attr_node
class ArgsortAttrs(Attrs):
    """Attributes for algorithm.argsort"""


@register_relay_attr_node
class OnDeviceAttrs(Attrs):
    """Attributes for annotation.on_device"""


@register_relay_attr_node
class DebugAttrs(Attrs):
    """Attributes for debug"""


@register_relay_attr_node
class DeviceCopyAttrs(Attrs):
    """Attributes for tensor.device_copy"""


@register_relay_attr_node
class CastAttrs(Attrs):
    """Attributes for transform.cast"""


@register_relay_attr_node
class ConcatenateAttrs(Attrs):
    """Attributes for tensor.concatenate"""


@register_relay_attr_node
class TransposeAttrs(Attrs):
    """Attributes for transform.transpose"""


@register_relay_attr_node
class ReshapeAttrs(Attrs):
    """Attributes for transform.reshape"""


@register_relay_attr_node
class TakeAttrs(Attrs):
    """Attributes for transform.take"""


@register_relay_attr_node
class InitOpAttrs(Attrs):
    """Attributes for ops specifying a tensor"""


@register_relay_attr_node
class ArangeAttrs(Attrs):
    """Attributes used in arange operators"""


@register_relay_attr_node
class StackAttrs(Attrs):
    """Attributes used in stack operators"""


@register_relay_attr_node
class RepeatAttrs(Attrs):
    """Attributes used in repeat operators"""


@register_relay_attr_node
class TileAttrs(Attrs):
    """Attributes used in tile operators"""


@register_relay_attr_node
class ReverseAttrs(Attrs):
    """Attributes used in reverse operators"""


@register_relay_attr_node
class SqueezeAttrs(Attrs):
    """Attributes used in squeeze operators"""


@register_relay_attr_node
class SplitAttrs(Attrs):
    """Attributes for transform.split"""


@register_relay_attr_node
class StridedSliceAttrs(Attrs):
    """Attributes for transform.stranded_slice"""


@register_relay_attr_node
class SliceLikeAttrs(Attrs):
    """Attributes for transform.slice_like"""


@register_relay_attr_node
class ClipAttrs(Attrs):
    """Attributes for transform.clip"""


@register_relay_attr_node
class LayoutTransformAttrs(Attrs):
    """Attributes for transform.layout_transform"""


@register_relay_attr_node
class ShapeOfAttrs(Attrs):
    """Attributes for tensor.shape_of"""


@register_relay_attr_node
class MultiBoxPriorAttrs(Attrs):
    """Attributes for vision.multibox_prior"""


@register_relay_attr_node
class MultiBoxTransformLocAttrs(Attrs):
    """Attributes for vision.multibox_transform_loc"""


@register_relay_attr_node
class GetValidCountsAttrs(Attrs):
    """Attributes for vision.get_valid_counts"""


@register_relay_attr_node
class NonMaximumSuppressionAttrs(Attrs):
    """Attributes for vision.non_maximum_suppression"""


@register_relay_attr_node
class ROIAlignAttrs(Attrs):
    """Attributes for vision.roi_align"""


@register_relay_attr_node
class ROIPoolAttrs(Attrs):
    """Attributes for vision.roi_pool"""


@register_relay_attr_node
class YoloReorgAttrs(Attrs):
    """Attributes for vision.yolo_reorg"""


@register_relay_attr_node
class ProposalAttrs(Attrs):
    """Attributes used in proposal operators"""
275 276 277 278 279 280 281 282 283 284


@register_relay_attr_node
class MaxPool2DAttrs(Attrs):
    """Attributes used in max_pool2d operators"""


@register_relay_attr_node
class AvgPool2DAttrs(Attrs):
    """Attributes used in avg_pool2d operators"""
285 286 287


@register_relay_attr_node
288 289 290 291 292 293 294 295 296 297
class MaxPool1DAttrs(Attrs):
    """Attributes used in max_pool1d operators"""


@register_relay_attr_node
class AvgPool1DAttrs(Attrs):
    """Attributes used in avg_pool1d operators"""


@register_relay_attr_node
298 299 300 301 302 303 304 305 306 307
class MaxPool3DAttrs(Attrs):
    """Attributes used in max_pool3d operators"""


@register_relay_attr_node
class AvgPool3DAttrs(Attrs):
    """Attributes used in avg_pool3d operators"""


@register_relay_attr_node
308 309 310 311 312 313 314 315 316 317 318 319
class BitPackAttrs(Attrs):
    """Attributes used in bitpack operator"""


@register_relay_attr_node
class BinaryConv2DAttrs(Attrs):
    """Attributes used in bitserial conv2d operators"""


@register_relay_attr_node
class BinaryDenseAttrs(Attrs):
    """Attributes used in bitserial dense operators"""
320 321 322 323 324


@register_relay_attr_node
class Conv2DTransposeAttrs(Attrs):
    """Attributes used in Transposed Conv2D operators"""
325 326 327 328 329


@register_relay_attr_node
class SubPixelAttrs(Attrs):
    """Attributes used in depth to space and space to depth operators"""