
# Autogenerated by mlir-tblgen; don't manually edit.

from enum import IntEnum, auto, IntFlag
from ._ods_common import _cext as _ods_cext
from ..ir import register_attribute_builder
_ods_ir = _ods_cext.ir

class EdgeNodeType(IntEnum):
    """edge node type enum"""

    OPERAND = 0
    RESULT = 1

    def __str__(self):
        if self is EdgeNodeType.OPERAND:
            return "operand"
        if self is EdgeNodeType.RESULT:
            return "result"
        raise ValueError("Unknown EdgeNodeType enum entry.")



@register_attribute_builder("Sdy_EdgeNodeType")
def _sdy_edgenodetype(x, context):
    return _ods_ir.IntegerAttr.get(_ods_ir.IntegerType.get_signless(32, context=context), int(x))

class PropagationDirection(IntEnum):
    """propagation direction enum"""

    NONE = 0
    FORWARD = 1
    BACKWARD = 2
    BOTH = 3

    def __str__(self):
        if self is PropagationDirection.NONE:
            return "NONE"
        if self is PropagationDirection.FORWARD:
            return "FORWARD"
        if self is PropagationDirection.BACKWARD:
            return "BACKWARD"
        if self is PropagationDirection.BOTH:
            return "BOTH"
        raise ValueError("Unknown PropagationDirection enum entry.")



@register_attribute_builder("Sdy_PropagationDirection")
def _sdy_propagationdirection(x, context):
    return _ods_ir.IntegerAttr.get(_ods_ir.IntegerType.get_signless(32, context=context), int(x))

