# automatically generated by the FlatBuffers compiler, do not modify

# namespace: tflite

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class StablehloConvolutionOptions(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAs(cls, buf, offset=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = StablehloConvolutionOptions()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def GetRootAsStablehloConvolutionOptions(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    @classmethod
    def StablehloConvolutionOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)

    # StablehloConvolutionOptions
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # StablehloConvolutionOptions
    def WindowStrides(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # StablehloConvolutionOptions
    def WindowStridesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # StablehloConvolutionOptions
    def WindowStridesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloConvolutionOptions
    def WindowStridesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        return o == 0

    # StablehloConvolutionOptions
    def Padding(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # StablehloConvolutionOptions
    def PaddingAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # StablehloConvolutionOptions
    def PaddingLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloConvolutionOptions
    def PaddingIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        return o == 0

    # StablehloConvolutionOptions
    def LhsDilation(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # StablehloConvolutionOptions
    def LhsDilationAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # StablehloConvolutionOptions
    def LhsDilationLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloConvolutionOptions
    def LhsDilationIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        return o == 0

    # StablehloConvolutionOptions
    def RhsDilation(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # StablehloConvolutionOptions
    def RhsDilationAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # StablehloConvolutionOptions
    def RhsDilationLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloConvolutionOptions
    def RhsDilationIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        return o == 0

    # StablehloConvolutionOptions
    def WindowReversal(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.BoolFlags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # StablehloConvolutionOptions
    def WindowReversalAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.BoolFlags, o)
        return 0

    # StablehloConvolutionOptions
    def WindowReversalLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloConvolutionOptions
    def WindowReversalIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        return o == 0

    # StablehloConvolutionOptions
    def InputBatchDimension(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # StablehloConvolutionOptions
    def InputFeatureDimension(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # StablehloConvolutionOptions
    def InputSpatialDimensions(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # StablehloConvolutionOptions
    def InputSpatialDimensionsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # StablehloConvolutionOptions
    def InputSpatialDimensionsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloConvolutionOptions
    def InputSpatialDimensionsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        return o == 0

    # StablehloConvolutionOptions
    def KernelInputFeatureDimension(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # StablehloConvolutionOptions
    def KernelOutputFeatureDimension(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # StablehloConvolutionOptions
    def KernelSpatialDimensions(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # StablehloConvolutionOptions
    def KernelSpatialDimensionsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # StablehloConvolutionOptions
    def KernelSpatialDimensionsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloConvolutionOptions
    def KernelSpatialDimensionsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        return o == 0

    # StablehloConvolutionOptions
    def OutputBatchDimension(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # StablehloConvolutionOptions
    def OutputFeatureDimension(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # StablehloConvolutionOptions
    def OutputSpatialDimensions(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # StablehloConvolutionOptions
    def OutputSpatialDimensionsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # StablehloConvolutionOptions
    def OutputSpatialDimensionsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloConvolutionOptions
    def OutputSpatialDimensionsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
        return o == 0

    # StablehloConvolutionOptions
    def FeatureGroupCount(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # StablehloConvolutionOptions
    def BatchGroupCount(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # StablehloConvolutionOptions
    def PrecisionConfig(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # StablehloConvolutionOptions
    def PrecisionConfigAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint32Flags, o)
        return 0

    # StablehloConvolutionOptions
    def PrecisionConfigLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloConvolutionOptions
    def PrecisionConfigIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        return o == 0

def StablehloConvolutionOptionsStart(builder):
    builder.StartObject(17)

def Start(builder):
    StablehloConvolutionOptionsStart(builder)

def StablehloConvolutionOptionsAddWindowStrides(builder, windowStrides):
    builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(windowStrides), 0)

def AddWindowStrides(builder, windowStrides):
    StablehloConvolutionOptionsAddWindowStrides(builder, windowStrides)

def StablehloConvolutionOptionsStartWindowStridesVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)

def StartWindowStridesVector(builder, numElems):
    return StablehloConvolutionOptionsStartWindowStridesVector(builder, numElems)

def StablehloConvolutionOptionsAddPadding(builder, padding):
    builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(padding), 0)

def AddPadding(builder, padding):
    StablehloConvolutionOptionsAddPadding(builder, padding)

def StablehloConvolutionOptionsStartPaddingVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)

def StartPaddingVector(builder, numElems):
    return StablehloConvolutionOptionsStartPaddingVector(builder, numElems)

def StablehloConvolutionOptionsAddLhsDilation(builder, lhsDilation):
    builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(lhsDilation), 0)

def AddLhsDilation(builder, lhsDilation):
    StablehloConvolutionOptionsAddLhsDilation(builder, lhsDilation)

def StablehloConvolutionOptionsStartLhsDilationVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)

def StartLhsDilationVector(builder, numElems):
    return StablehloConvolutionOptionsStartLhsDilationVector(builder, numElems)

def StablehloConvolutionOptionsAddRhsDilation(builder, rhsDilation):
    builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(rhsDilation), 0)

def AddRhsDilation(builder, rhsDilation):
    StablehloConvolutionOptionsAddRhsDilation(builder, rhsDilation)

def StablehloConvolutionOptionsStartRhsDilationVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)

def StartRhsDilationVector(builder, numElems):
    return StablehloConvolutionOptionsStartRhsDilationVector(builder, numElems)

def StablehloConvolutionOptionsAddWindowReversal(builder, windowReversal):
    builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(windowReversal), 0)

def AddWindowReversal(builder, windowReversal):
    StablehloConvolutionOptionsAddWindowReversal(builder, windowReversal)

def StablehloConvolutionOptionsStartWindowReversalVector(builder, numElems):
    return builder.StartVector(1, numElems, 1)

def StartWindowReversalVector(builder, numElems):
    return StablehloConvolutionOptionsStartWindowReversalVector(builder, numElems)

def StablehloConvolutionOptionsAddInputBatchDimension(builder, inputBatchDimension):
    builder.PrependInt64Slot(5, inputBatchDimension, 0)

def AddInputBatchDimension(builder, inputBatchDimension):
    StablehloConvolutionOptionsAddInputBatchDimension(builder, inputBatchDimension)

def StablehloConvolutionOptionsAddInputFeatureDimension(builder, inputFeatureDimension):
    builder.PrependInt64Slot(6, inputFeatureDimension, 0)

def AddInputFeatureDimension(builder, inputFeatureDimension):
    StablehloConvolutionOptionsAddInputFeatureDimension(builder, inputFeatureDimension)

def StablehloConvolutionOptionsAddInputSpatialDimensions(builder, inputSpatialDimensions):
    builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(inputSpatialDimensions), 0)

def AddInputSpatialDimensions(builder, inputSpatialDimensions):
    StablehloConvolutionOptionsAddInputSpatialDimensions(builder, inputSpatialDimensions)

def StablehloConvolutionOptionsStartInputSpatialDimensionsVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)

def StartInputSpatialDimensionsVector(builder, numElems):
    return StablehloConvolutionOptionsStartInputSpatialDimensionsVector(builder, numElems)

def StablehloConvolutionOptionsAddKernelInputFeatureDimension(builder, kernelInputFeatureDimension):
    builder.PrependInt64Slot(8, kernelInputFeatureDimension, 0)

def AddKernelInputFeatureDimension(builder, kernelInputFeatureDimension):
    StablehloConvolutionOptionsAddKernelInputFeatureDimension(builder, kernelInputFeatureDimension)

def StablehloConvolutionOptionsAddKernelOutputFeatureDimension(builder, kernelOutputFeatureDimension):
    builder.PrependInt64Slot(9, kernelOutputFeatureDimension, 0)

def AddKernelOutputFeatureDimension(builder, kernelOutputFeatureDimension):
    StablehloConvolutionOptionsAddKernelOutputFeatureDimension(builder, kernelOutputFeatureDimension)

def StablehloConvolutionOptionsAddKernelSpatialDimensions(builder, kernelSpatialDimensions):
    builder.PrependUOffsetTRelativeSlot(10, flatbuffers.number_types.UOffsetTFlags.py_type(kernelSpatialDimensions), 0)

def AddKernelSpatialDimensions(builder, kernelSpatialDimensions):
    StablehloConvolutionOptionsAddKernelSpatialDimensions(builder, kernelSpatialDimensions)

def StablehloConvolutionOptionsStartKernelSpatialDimensionsVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)

def StartKernelSpatialDimensionsVector(builder, numElems):
    return StablehloConvolutionOptionsStartKernelSpatialDimensionsVector(builder, numElems)

def StablehloConvolutionOptionsAddOutputBatchDimension(builder, outputBatchDimension):
    builder.PrependInt64Slot(11, outputBatchDimension, 0)

def AddOutputBatchDimension(builder, outputBatchDimension):
    StablehloConvolutionOptionsAddOutputBatchDimension(builder, outputBatchDimension)

def StablehloConvolutionOptionsAddOutputFeatureDimension(builder, outputFeatureDimension):
    builder.PrependInt64Slot(12, outputFeatureDimension, 0)

def AddOutputFeatureDimension(builder, outputFeatureDimension):
    StablehloConvolutionOptionsAddOutputFeatureDimension(builder, outputFeatureDimension)

def StablehloConvolutionOptionsAddOutputSpatialDimensions(builder, outputSpatialDimensions):
    builder.PrependUOffsetTRelativeSlot(13, flatbuffers.number_types.UOffsetTFlags.py_type(outputSpatialDimensions), 0)

def AddOutputSpatialDimensions(builder, outputSpatialDimensions):
    StablehloConvolutionOptionsAddOutputSpatialDimensions(builder, outputSpatialDimensions)

def StablehloConvolutionOptionsStartOutputSpatialDimensionsVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)

def StartOutputSpatialDimensionsVector(builder, numElems):
    return StablehloConvolutionOptionsStartOutputSpatialDimensionsVector(builder, numElems)

def StablehloConvolutionOptionsAddFeatureGroupCount(builder, featureGroupCount):
    builder.PrependInt64Slot(14, featureGroupCount, 0)

def AddFeatureGroupCount(builder, featureGroupCount):
    StablehloConvolutionOptionsAddFeatureGroupCount(builder, featureGroupCount)

def StablehloConvolutionOptionsAddBatchGroupCount(builder, batchGroupCount):
    builder.PrependInt64Slot(15, batchGroupCount, 0)

def AddBatchGroupCount(builder, batchGroupCount):
    StablehloConvolutionOptionsAddBatchGroupCount(builder, batchGroupCount)

def StablehloConvolutionOptionsAddPrecisionConfig(builder, precisionConfig):
    builder.PrependUOffsetTRelativeSlot(16, flatbuffers.number_types.UOffsetTFlags.py_type(precisionConfig), 0)

def AddPrecisionConfig(builder, precisionConfig):
    StablehloConvolutionOptionsAddPrecisionConfig(builder, precisionConfig)

def StablehloConvolutionOptionsStartPrecisionConfigVector(builder, numElems):
    return builder.StartVector(4, numElems, 4)

def StartPrecisionConfigVector(builder, numElems):
    return StablehloConvolutionOptionsStartPrecisionConfigVector(builder, numElems)

def StablehloConvolutionOptionsEnd(builder):
    return builder.EndObject()

def End(builder):
    return StablehloConvolutionOptionsEnd(builder)
